With my current application, several devices can connect to one device. But the contrast doesn't work. I assume that device A initiated connection to device B. Now if A tries to keep the connection to B and initiate another connection to device C, then the connection of A-B is broken. So is there a way to avoid connection of A-B being lost while connecting to A-C?
Thanks in advance
This may be a problem with the version/implementation of Android you are using: I have found that it is impossible with certain Android versions (2.2 or lower) on certain devices (Samsung and the Nexus One) it is impossible to run multiple bluetooth device connections at the same time. The exact same apk that works perfectly on 2.3.3 will fail on a Nexus One running 2.2 or a Samsung Vibrant running 2.2. I'd look at the version of Android you are using and see if running on a newer revision fixes this problem for you.
Related
I wanna use a library from GitHub named "Android Network Tools", but actually I have a complex issue when using that. I tested the ping of this library on different type of devices and Android versions, and it worked correctly and was perfect, but when I tested it on my Samsung Galaxy S8 with android 8 I saw pinging external IP(like google.com) didn't work! at the first, I thought it happens in Android 8 and tried to solve it, but I launched it in Android 8 with the emulator that was ok! after that, I decided to test it on my friend's Samsung J7, you can guess that what happened, it didn't work again!
Right now, I'm really really confused because of I don't know why it happens just on Samsung devices, do you have any idea?
The problem is not with your code , the problem is occurring because of Device manufacturers They change the Os according to there need which causes issue with ping , see
Why does ping works on some devices and not others?
Finally, I found the problem, this was about control running apps in the background! when that feature be enabled some methods and ping doesn't work correctly in real-time.
power saving mode
Yes this is correct. With any power saving mode active, on at least some Android o/s versions, ping will not function. I'm guessing icmp echo reply packets are dropped. A sniffer app would confirm this. It is possible icmp echo (outbound) packets aren't even generated. Crazy in my view. Most ping utilities are very lightweight and I would have thought consume minimal power. I'm running a Samsung J5 / Android v.7.0. Ping started working once I disabled power saving mode
I was testing WiFi Direct on my Android Devices. I have a Galaxy Note running 4.0.4, and a Nexus 7 running 4.2.1. I followed exactly from the official API on WiFiDirect.
After the devices found each other, if I try to make them "connect", I'll be able to see an invitation of WifiDirect connection, but after I "accept" this invitation, the status of this device changed to "invited", while on the other device (which sent the invitation initially) got no response. Thus a wifi-direct connection can never be made among the two device.
I then tried the official Wifi-Direct Demo program... but it doesn't seems to work also.
After I rooted my Galaxy Note and upgraded it to 4.1.2, this problem disappeared.
But I wonder if anyone encounter same problem as I did? And if so how did you solved it?
Thanks a lot.
To find the exact reason you have to look at the log report of wpa_supplicant(this can be seen from the log report using android debug bridge(adb) available in adt bundle with eclipse # http://developer.android.com/sdk/index.html ).
I have faced a similiar problem while trying to connect androd 4.0 tablet with ubuntu laptop.The problem was with the dhcp server which was supposed to assign an IP address after the Group negotiation is successful but it wasn't respondig may be due to difference in the versions or some other reason.This wasn't a bug with wifi direct.
I fixed it by assigning a static IP address to the p2p_wlan0 interface on both the devices.
I work at a company that programs for Android devices. As such, I connect and have connected hundreds of Android devices to my computer. Each time I connect a new device (which can be the same model as another device that I had previously connected) Windows runs the Driver Software Installation process.
When I first got this computer it would take about a minute to detect the device. Maybe a little longer the very first time, but not too long.
Now, after hundreds of devices have been connected to push software to them, the Driver Software Installation dialog takes about 20 minutes to detect one device.
Is there a way to speed this process up at all? I looked online and have uninstalled all the Android drivers for old devices under Device Manager, but even after uninstalling them all it still takes about 20 minutes to detect one device.
Thanks for any help or insight as to fix this issue.
Adam
There are these drivers available for each company like Motorola, samsung etc for android. You need to install just all the available i.e. on driver for all samsung one for all motorola. That way you could just start off as soon as you plug-in. Just google for motorola driver android , you'll get it.
It seems to be a driver bug. I tried different Android phones in many computers with windows XP, 7, and 8 and the connection process is very slow in all of them, you have to live with it.
I am trying to run the Android IOIO development board on the Samsung Galaxy Tab 10.1. I am so far unable to do so. My Droid X starts up on the IOIOSimpleApp on plug in. However, when I plug in my Tab, the whole screen remains disabled and does not work. I have the Build to be Google API 2.3.3 API Level 10. I do not know what else to mention but that when I run the app it doesn't "see" the IOIO board.
Another problem I am having is my application changes data on a server. The phone is able to make changes but the same app on the tablet doesn't make changes to the server. I think it may be with the app compatibility with the tablet but I am not sure. Any help/suggestions?
Thanks ahead of time.
The normal sequence for checking IOIO connection problems:
Is the charging icon on your Android on? If not: power supply problem. Check that the trim pot on the IOIO is all the way clockwise. Check that your power supply is 5V-15V, 10W or greater, connected between Vin and GND with the correct polarity. Check that nothing on your IOIO gets hot. Move to step 2 only if you're getting charging icon, or else you'll be wasting your time.
Enable USB debugging on the Android and connect IOIO over USB. Are you getting the debug icon (little Android bug)? If not, your IOIO may be running an old version of the firmware, which is known to have had a few USB bugs that are now fixed. Specifically, any bootloader < V3.03 and app firmware < V3.23 may be suffering from this bug. If you have an Android on which the IOIO does work, you can figure out your firmware version by running any IOIO app (e.g. HelloIOIO) and checking the logcat output for a message with all the IOIO version numbers. Unless you have V3.03 bootloader and V3.23 app, an upgrade might help. Move to step 3 only if you're getting the debugging icon.
You're getting the debug icon but your app doesn't work. Try one of the stock apps, preferably the HelloIOIO.apk (precompiled) version that comes with the software bundle. Run it and then search the logcat for IOIO related messages. If HelloIOIO works, this may be a problem with your application or build environment. Again, check logcat for clues.
If none of this works, start a thread on the ioio-users list and give as many details as possible on your problem (what you've tried, which Android model and OS version you have, what you're seeing).
I am trying to develop an wifi peer to peer application in android(4.+).
The problem here is how to test it.
I tried to run that application in android emulator. there was no option to configure wifi in the settings menu, i also tired to enable wifi using the dev tools application form the emulator but it didn't work, And through all my googling over 3 days and i found that Android emulator is not supported the Wifi.
So i opted for androidx86 4.0eeepc using virtual box and tired to add devices both wifi and bluetooth (my app uses both bluetooth and wifi) but only bluetooth device got added and it did not work. But my virtual box detected the wifi and bluetooth devices. I just couldnt get them work with the virtual machine.
I tried everything like manually adding the addresses using terminal emulator app in androidx86 and used netcfg through the android commandline but neither of them worked.
Please suggest and guide me on the correct path to run these kind of applications that use wifi and bluetooth in android.
Thanks in advance.
First, be sure you enabled WiFi Direct in the Android settings for the two virtualbox instances:
Settings --> Wireless & Networks --> More... --> Wi-Fi direct
It has been stated as working once that hurdle was overcome, and I'm sure many have experienced the same...just be sure to enable wifi direct
I would have tried exactly what you've already tried by naturally moving from the emulator to the androidx86 project. Although unreliable, I'd recommend looking at and finagling this, if you haven't yet seen it: Android: Simulate WiFi in the emulator? and How to disable/enable network, switch to Wifi in Android emulator? most likely wouldn't have full out success but may be enough to let you know that it works or would work.
As far as testing WiFi-Direct/WiFiP2P without you yourself having a device/s, I would recommend:
Trying out some of the fiddling as mentioned above. And read through tons of logs.
You could always crowd source it to friends, or release an apk on a forum for a small group of testers.
Of course, both of those options are not ideal, seamless, or fast. So, I'd definitely hope you get VirtualBox VMs of AndroidX86 4.0 running as it should once you check that setting and pair up the WiFi APs :-)
A near future solution:
This might be something to look into in near future.
Real devices are hosted by Samsung and screens are streamed to your PC.
http://developer.samsung.com/remoteTestLab.do
According to an email responded by samsung, which I sent to them earlier.
They only have 2 devices (Galaxy Nexus) running on Android v4.0 at the moment.
Unfortunately they are not physically close to each other. (One in Korea, One in Poland)
But they are planning to upgrade existing Galaxy S2 to v4.0.
Because recently Samsung have released v4.0 upgrade for S2.
Once they done that, there will be plenty of v4.0 phones.
And you can ask them which 2 phones are physically close so you can test Wifi Direct.
--------------------------- EDIT ---------------------------------
There are plenty of ICS devices there now, which you can test P2P.
Check with them which 2 are physically near to each other.
Per the docs:
Each instance of the emulator runs behind a virtual router/firewall
service that isolates it from your development machine's network
interfaces and settings and from the internet.
You have to use Network Redirection, as described in the Developer Docs. In essence, you forward specific ports using ADB. Therefore you cannot test certain things like broadcast messages.
I have tried doing what you are trying to do, and-- while I won't say it is impossible (anything is possible in computing with enough time, money, and persistence)-- I wasted a lot of time on it. You cannot treat the Android emulator as a normal network peer-to-peer device. As far as I have been able to find, it is a fork of QEMU, and that is just how the QEMU emulator is implemented.
QEMU itself does support TUN/TAP bridging, but I was never able to get it working with the Android emulator. If you want to go that route, you may want to investigate running Android in the QEMU emulator, rather than in the SDK's emulator (I see you are already trying a similar approach with VirtualBox).
Unfortunately the best way to test a peer-to-peer networking program in Android is with physical devices at this time-- unless your app can suffice with the port forwarding method.
See Also: Issue 26:Emulated Androids should be able to communicate via TCP, and Google
(Repeating here my answer elsewhere.)
In theory, linux (the kernel underlying android) has mac80211_hwsim driver, which simulates WiFi. It can be used to set up several WiFi devices (an acces point, and another WiFi device, and so on), which would make up a WiFi network.
It's useful for testing WiFi programs under linux. Possibly, even under user-mode linux or other isolated virtual "boxes" with linux.
In theory, this driver could be used for tests in the android systems where you don't have a real WiFi device (or don't want to use it), and also in some kind of android emulators. Perhaps, one can manage to use this driver in android-x86, or--for testing--in android-x86 run in VirtualBox.