Is it possible to connect an Android smartphone working a host to a computer (working as a device?) I am writing an app that is supposed to remote control a camera via smartphone. I have some trouble testing my app since emulators don't support usb connections. But when I connect my smartphone to the camera I can't really tell what goes wrong. I thought of connecting the phone to a computer so that it could e.g. display the characters it is receiving but I don't really know if it would work, as computers usually work as host to other devices, not the other way around.
Thanks a lot for any tips.
You might wanna take a look here http://developer.android.com/guide/topics/usb/host.html
Altho as mention somewhere no google io mobile in android 3.1 didnt support host mode, maybe this has changed in 4.0 which might be true basing on this video http://www.youtube.com/watch?v=sQGxckZkH2g
A computer cannot act as a Device. If you want to see what is happening on your smartphone when you connect your camera, use the
adb shell dmesg commands to look at the logs and see if the camera is being detected.
Related
I have drone( DJI Phantom 3), and in order to fly it correctly DJI provides an App for IOS and Android("DJI Go"). The thing is that I have a Kolina k100 android phone(a cheap chineese one), and I can install the app perfectly, and it runs quite well with an only exception. When I put the Drone on video-recording mode, I loose the live-video and I can not see what my drone sees. Obviously DJI has told me that he doesn't support my chinese phone so they do nothing. So I was thinking that maybe is a problem of how powerful my phone is.
So I wanted to check if the App works well in my laptop so I downloaded the app in Bluestacks, but I realised that to make the app work I have to connect the drone's RC controller by USB (as I do with my phone). But when I connect the controller to the laptop, Windows recognizes it. But Bluestack doesn't care so the app doesnt work. How can I make Bluestack recognize the USB connection of the controller?
Thanks in advance, any help will be appreciated.
I'm just starting on some development using the android accessory protocol. I have sourced a starters kit (microchip) to get familiar with the environment. I should note that I' have a solid background in embedded C, but not really in Android / Java.
The kit connects using USB, so I have configured my phone to use ADB over Wifi, which works great. I compile the app and can debug in the phone just fine. However, it will not recognize when the accessory is connected to the USB port. When I stop the wireless ADB, the app will recognize the accessory just fine and works as it should.
I have a hard time finding out whether this is expected behavior or not, but as it would stop any debugging on an app communicating with a USB accessory I doubt it and suspect I am doing something wrong.
I use a Galaxy S3 I9300 rooted, and microchip's Accessory Development Starters Kit and provided samples.
ADB-over-wifi does disconnect after an accessory is connected. To mediate that, switch the phone to accessory mode and after that connect the ADB-over-wifi. That way eclipse can reconnect to the debugging session.
Another way is to run a shell a shell script in the background that will infinitely connect the ADB-over-wifi.
I did not find more elegant ways to solve this problem.
Ok. it seems to be related to the "USB Debugging" option in the developer options. When I disable it, it works as expected.
I have not been able to try it on lots of different phones but on the 2 I have access to this seems to be consistent (Galaxy S3 and HTC One).
I can't find any specifics on this behavior on the net though.
From latest SDK, multi-touch is supported via tethered phone. I'm wondering whether it is supported programmatically. In other words, can we test multi-touch triggered functionalities using automated test suites?
No it's not. but from sdk-r20 you can use multitouch in emulator with a real phone connected to computer. check this out.
I'm working on this same problem. First I'm tested to make sure all tethered signals are going through (I had to modify the SDkController app to even get the connection). Now I'm trying to figure out why, when I click the side of the screen or anywhere, it only shows up on the top right (while the debugger from the emulator is giving the correct thing). The error is explained here.
I did however figure out how to do it wirelessly and through the terminal. If that is what you're asking the procedure is pretty much the same. You need to root your device or do the adb port command (with USB connected) before un-connecting your device, and it'll work wirelessly.
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.
Currently I'm working on a project that demands using Android and tcpdump.
A short description of what I do:
I want sniff packets using android. I have built an android application which does this using by "tcpdump".
Basically the application initiate tcpdump, which dumps the captured packet in a file (in the sdcard). Then I process the captured packets just by opening the file.
The problem :
When the wifi is in managed mode, everything works fine. But, when I put the wifi device in "ad-hoc" the wireless device stops working.
I'm using "Samsung Captivated S" (SGH - I897), and in order support "overhearing" (promiscuous mode) and ad-hoc I installed the latest "Cyanogen 7" rom ( cm_galaxysmtd_full-126.zip, from: http://download.cyanogenmod.com/?type=nightly&device=galaxysmtd)
I don't know how to solve this and I would really need your help. I suspect
that "wpa_supplicat" is to blame for that, but most probably I wrong.
Thanks in advance,
Ps: I should also mention that I start an adhoc network using my laptop. Then two android devices join the adhoc network. The android devices (SGH-I897) join the network without a problem. All the devices can ping each other.
only solution for this is described here.
http://www.44actions.com/?p=273