I trying to make a android App, that uses an usb device that need the tablet to be in HOST mode, so it can get power from the tablet. For some odd reason, this only happens every other time I restart the tablet and only if I have the power jack inserted.
So The solution I'm trying to make, is to find out after a reboot if the tablet is in USB Host mode and if not, then reboot automatically.
The tablets are rooted, so superadmin access is no problem and my reboot code is working fine, just can't seem to find anything that says how I can detect Host mode, can anyone share this knowledge with me?
Thanks in advance
Peter
releaseInterface() and close() closes the connection and stuff. I think then you should be able to getDeviceList() or soemthing.
I can't be too sure, since I used slickdev library to connect to my serial device, but this answer is based on data of this page:
http://developer.android.com/guide/topics/connectivity/usb/host.html
Related
My MacBook computer battery is broken and somehow it has not enough power to power device by usb-c adapter so I cannot connect anything and only have to use android emulator. But I need to debug on real device while testing some ocr sdk that obviously don't want to recognize anything in android emulator virtual scene. I asked other question about that but still I am puzzled by this inability to use WIFI for usb debugging because sdk runs fine on my phone but to debug using fabric and APK deployment is really horrible dev experience and productivity.
Is there some way I can setup WIFI debugging without cable at all... Maybe I need to root my device but again how to do it without cable, it seems impossible either way. I feel in like in dead and but still asking question here. I have computer and phone but cannot connect them for debugging by wifi.
Afraid I don't have an easy wireless solution. The closest thing I could find is that android wearables may have a debug over bluetooth feature, but it's built to route through another (wired) android device.
There is likely a feasible wired solution though- you can hook the device to a powered hub and the hub to the computer.
You could also use an adapter of sorts. They were built for printers and such before everything came with wifi and could get a proper wireless setup going without either side realizing they aren't directly connected over USB (OS still knows that some funky usb drivers are loaded and a separate application may need to run to connect), but again more hardware. A decent Wireless "USB Device Server" seems to run ~$100 while wired ones are cheaper, but not as cheap as a powered usb hub.
If you have another machine, you can use it to enable wireless debugging on your Android phone. See https://developer.android.com/studio/command-line/adb#wireless. Once wireless debugging is enabled, you can connect to it from your Mac without using USB. You still need USB for enabling wireless debugging though, but you can do it from a different machine. This should work on all Android phones, root is not required.
Update [2021]:
Things have developed since this question was asked. WiFi Debugging is a first class option now on newer devices. See https://developer.android.com/studio/run/device.html#wireless for details.
I am creating an app (running in USB accessory mode) that will recognise when a specially made device (that I am also working on) is plugged in and connect to it.
I have written code in the app for this recognition to happen but now need to test it and the specially made device is not made yet.
So, I was wanting to test my app by somehow setting my PC up to be recognised as a usb host device that my phone can connect to, I spent a long time googling and looking for a way to do this or a different way to test this but came up empty.
How do I set my PC up in this way to test my app or what would be a good way to test this automatic usb connecting?
Thank you kindly,
EDIT:
Even the name of a cheap device that runs in android usb host mode would be sufficient as I could still just plug that into my device to check if it is working.
I think your question is how to emulate USB Host mode with the Emulator and setting up a bridge with an emulated device on the PC. This is not possible (yet).
See Emulator documentation. In the "What's not supported section" it is said that virtual hardware is not supported for USB.
I have an android tablet "Galaxy Tab 10.1" and need to connect to my pc to debug but it even doesnt show up on Device Manager when I plug the cable. I saw many solutions and tried it, like:
Downloaded samsung usb driver from here:
http://www.samsung.com/us/support/owners/product/GT-P7510MAYXAB
Also in settings USB debugging is enabled.
But there is still no change! Is there any suggestion?? Thanks in advance!
Go to Settings->Select Storage->Click on the three dots->Usb Computer Connection->Experiment with either MTP or Camera. For my phone it works only with Camera mode.
Well, I changed the cable, reinstalled the drivers and worked :)
After you plugged in try to shutdown and then power on the tablet whilst connected. It solved my issue. Hope this helps!!
You could try turning USB debugging off. Also, is there maybe a setting to change the USB mode in settings? Most Android devices have one somewhere.
I've seen this quite a bit, and it seems that happens when the Samsung connector on the bottom of the device is not properly seated. Remove and firmly re-connect has solved the issue a few times for me.
Disconnecting & rebooting the device, run "adb kill-server", reconnect device, run "adb devices" - seems to solve a good few issues also.
Hi There i got a Simple Solution to share.
1st step: Dont connect your android tablet or phone on the computer in this time. :)
2nd step: if your android tablet or phone is on then TURN IT OFF!!
3rd step: NOW after you turn it OFF turn it ON again then connect to the computer Via USB cable..... SEE IF IT WORKS
download Kies and it will automatically download all required drivers - samsung file sync app
read more: http://www.samsung.com/latin_en/support/usefulsoftware/KIES/JSP
download: http://www.samsung.com/us/kies/
Okay Android made this much harder than it needs to be (as usual).
I fought this for two days and finally found a way to turn USB sharing on on the tablet. I loaded the drivers to the computer and it recognized the device but would not read it. The solution was to go to settings, storage and then ignore everything in the storage box. In the top left corner a USB symbol will appear very small next to the sd card logo (if one is mounted) Long Press and drag that down to open a message box. There will be an option to turn on USB sharing.
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.
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.