in my app i can connect to a wifi network using the presharedkey without any problems.
And my Phone (Galaxy Nexus) is able to connect via WPS in wifi-network-settings.
But now I am trying to connect to a wifi network using the WPS pin method. (enter pin on device)
I googled alot and found "android.net.wifi.WpsInfo"
http://developer.android.com/reference/android/net/wifi/WpsInfo.html
Whith this i am able to set up the WPS-settings, but how can i use this to connect to a wifi network?
I started programming android-apps just a few days ago,
could someone with a bit more experience & knowledge help me, pleas?
(I am using api15, Android 4.0.3)
Related
We are building an Android App which will let it connect to other android devices via a Socket Connection through a Wifi Hotspot created in the Server Android Device.
For most of the cases, this works perfectly. However for some cases, no matter how many times we try, a device is not able to connect to a WiFi Hotspot. This issue is not device specific. A device which is able to connect now, may not be able to connect at some other time.
While we were desperately looking for workarounds, we realized that if we Switch on and off the Hotspot in the connector, then it connects immediately to a WiFi Hotspot it was not able to connect previously.
Can anyone help us understand why is this happening? Also, is there anyway we can replicate this without switching off the WiFi Radio(switching on the Hotspot switches the Radio off)?
I currently have a pair of google glass paired through bluetooth to an LG G2.
My LG G2 can access the internet and my network without an issue.
Glass can search web pages and browse the internet without an issue.
My custom application works fine through WiFi on my phone and on glass, if glass is going through WiFi.
However I have a custom application that I made that cannot connect to a server on my network through the bluetooth tether. I haven't been able to find anything regarding special permissions or programming changes that would need to be done when tethering, so am I missing something critically important here?
It is absolutely critical that I use my phone's wifi because it supports 5 Ghz WiFi and 2.4 Ghz is completely saturated where I am.
Currently I am trying to use the libstreaming example 3 to stream video to a server:
https://github.com/fyhertz/libstreaming/wiki/Using-libstreaming-with-Wowza-Media-Server
My manifest has been modified to include
android.permissions.BLUETOOTH
android.permissions.BLUETOOTH_ADMIN
I've also hard coded my server IP address and the correct settings to automatically start the video stream inside onCreate. This all works on my phone but I get a connection timeout when connecting through glass when bluetooth tethered.
With the following steps I was able to connect from Google Glass to a server socket:
enable android.permissions.INTERNET to the manifest file
on the android phone: settings->wireless..more->tethering & hotspot ->activate bluetooth tethering
maybe this helps...
As far as I can tell, when data is connected you do not get an ip address... Thus your socket isn't really able to connect. Data requests are sent through bluetooth and really it is your phone making the request....
I will try to look into it, but right now bluetooth connectivity yields an ip address of 0.0.0.0
I've setup a racoon server on my linux router. It was working ok with my xperiaz (C6603) road warrior. However after I applied the latest update to android 4.4.2 (firmware 10.5.A.0.230) it stopped working correctly. I have ping from the phone to each ip (local ip or internet) but when I use FQDN it can't be resolved. I can ping the phone from within my local network too. VPN is IPSec Xauth RSA. Checking with adb DNS server is correctly set:
getprop net.dns1
192.168.6.1
I also tried pushing the same ip as dns2 but no change. I also noticed that after closing the connection to the vpn server net.dns1 remains 192.168.6.1 however the phone is able to correctly resolve addresses. In few minutes it gets changed back to my 3g provider setting.
I tried to redirect all traffic through the tunnel via the advanced vpn setting (Forwarding routes = 0.0.0.0/0) and tried to set DNS statically via the same settings (DNS servers = 192.168.6.1). Even setting the DNS server to my provider's DNS addres didn't work which makes me think the problem is with the android itself.
DNS server is working as far as I can tell:
$ dig #192.168.6.1 dir.bg +short
194.145.63.12
Forwarding is enabled on my router so shouldn't be the problem. I've read about a bug in android but it's in android 2.x and seems to impact wifi connections.
Have you seen similar problems and as I'm not an expert with android and adb, can you tell me what commands are available in adb/shell to trace the problem? Phone is not rooted and it's not possible for the moment to root it.
UPDATE:
the tunnel is working ok when I connect via wifi hotspot. The problem appears to show only via my 3g carrier. Any ideas how to work around this?
After updating to 4.4.4 I still got the same problem. Further testing revealed that the problem is more likely to be in the Android rather than my 3g carrier. Over wifi the VPN worked flawlessly after using wifi tethering from another phone via the same provider it worked ok again so my 3g carrier isn't blocking anything.
Yesterday I finally rooted my phone and installed SDFix to restore full access to my SD card. Now VPN is working ok again even via 3g. I hope someone can confirm/reject that solution as I see no relation between vpn and sd card at all. However I experienced initially the problem with my update to 4.4.2 where Sony started to follow Google's policy about storage access.
I develop app which contains a client and a server side, so I need to test work between them. I have a real android device and I want android device to connects to emulator. I'm working at work sometimes(if I have free time of course) and at home. I have the WiFi router at home and I can connect to the real device by emulator(TCP listener running on the real device), but not vise versa(I don't know which exactly IP to use). But at work I have only hot-spot WiFi point without router. My android device connects to it fine. Even more ADB can connect to the device when adbWireless running on it. But it doesn't work, I can't connect to tcp listener in any cases. The difference between home and work is existence of WiFi router. Are there any solutions? If not why Android debug bridge(ADB) can connect to adbWireless? Thanks.
I solved the problem. I run tethering on my real device and run the server on it. Then I use a program Connection state viewer there is a link: https://play.google.com/store/apps/details?id=ru.nolesh.android.connectionstateviewer It helps me to find IP address. After that I start the emulator and the client side on it. So I connect to my server by given IP.
Iam connecting 3G phone for my Android device for internet connection and another Socket(SPP) for CAN signal receiving.Whenever I manually connect to the Bluetooth tethering via 3G phone, i can browse internet perfectly and speed is good.Whenever programmatically connect to the 3G connection, i couldn't browse internet.i checked in shell and observing that in my mobile 'device is connected' message displayed and E symbol appears.No problem for me to connect Socket.But I got problem to use 3G phone.For this iam using APN/DUN mode.I checked both but no use.Is there any performance issue here or anything wrong to connect different devices by using Bluetooth API in android.Why this happends while connecting Mobile programmatically.Please give me guidance.
Regards,
Rajendar
Yes, you can have several open connections at a time.
In fact, I've used my hands-free bluetooth on my phone, as it is connected to my ELM327 SPP device streaming at full speed. I didn't notice any hiccups.
As for losing connectivity when you are connected to multiple devices, it's most likely an issue with the DUN provider you're using.
Also it's worth stating that, on Verizon/3g phones, when you use the phone as a phone, it suspends all 3g data services until the call is terminated.
The way L2CAP defines the LT_ADDR allows connecting devices up to 7. Your connection problems is something else.