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)?
Related
I can't seem to find a solution for this. Either it hasn't been asked, is impossible, or I used wrong key words, so I'm gonna try and ask here.
My problem is that I have two phones and a laptop.
My Laptop has WAMP 3.0.6 on it and has my database and server.
One phone is connected via tethering USB cable to the Laptop and has its Tethering Hotspot on.
The other phone is connected to the first phone via Wifi to Hotspot connection.
However, when I try to use the method of http://IP:PORT on the second phone, it shows a Not Allowedor net::ERR_CONNECTION_TIMED_OUT warning instead of my Localhost page.
Can anybody give some help on this?
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.
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)
Is it possible to connect two android phones (rooted) with wifi programatically and exchange data?
I know it is possible to do tethering using wifi-android-tether. But i need to establish the connection, and exchange the data, all through my android application. User intervention like switching on the android tether app manually is not allowed.
SO basically its like, if i run my app on two droid phones, they should do the following,
Detect that they have wifi.
DEtect that the other phone has its wifi on.
Establish a connection ( similar to a PAN in bluetooth ).
Exchange some data.
Use WiFi Direct. The sample codes in the SDK package will do for testing Peer-Peer connectivity.
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.