Access to USB devices on Chromebook running Android APK [duplicate] - android

I've got an Android application which can be remote controlled by USB midi devices. The app itself is running fine with google ARC but the USB module doesn't detect any USB device.
I already found that it is possible for Chrome apps to use usb but only when declaring each specific device in the manifest (https://developer.chrome.com/apps/app_usb).
Does Google ARC support USB access?
Will it be possible to get a list with all USB devices without declaring them first in the manifest?

Sorry, ARC does not currently implement a USB service that proxies to the Chrome USB interface.
Feel free to file a bug however.
If we do implement it, is will likely have the same limit where you must predeclare the devices you want access to, for the same reason listed on the page you link to.

Related note: a bug on UsbManager access within ARC was reported: https://code.google.com/p/chromium/issues/detail?id=475419

Related

Can android be the host to a USB device?

I have a USB device and want to build a nice graphical interface for it. Is it possible to connect the USB device to Android, have Android be the host, and communicate with it and build a UI? If so, which libraries would allow me to do this? And if not, what alternative workarounds are there? I would prefer a wired connection for reliability.
It's possible. I have personally used an USBc to USB cable to hook up everything from a keyboard and mouse to an external monitor. Some phones/devices may not have a data port on the external USB port or the chips needed for external monitors but android itself has USB drivers built in.
I think this question remained unanswered for so long because it's so easy to google the android developer page that should answer your question in specifics here. It's the developer guide for using android as a USB host.

pragmatically way to disable all USB ports on android, so that it does not recognize any removable storage or any other device

I need a pragmatically way to disable all USB ports on android for a MDM application, so that it does not recognize any removable storage or any other device (USB mouse, USB keyboard etc).
my application is already set as a system application so it will have the required permissions.
If you provision your device with your app as the device owner (using Android Enterprise, aka Android for Work) you can set these restrictions:
DISALLOW_MOUNT_PHYSICAL_MEDIA
DISALLOW_USB_FILE_TRANSFER
More details on building an app like this can be found here:
https://developers.google.com/android/work/build-dpc
I'm not sure how to prevent other devices like a mouse or keyboard, but I hope this helps some.
Also, if you want to easily test those two disallows out, look into the TestDPC app. Be sure to install it as a device owner so you have permission for those APIs. Google provides source code to it.
https://github.com/googlesamples/android-testdpc

ARC with USB access?

I've got an Android application which can be remote controlled by USB midi devices. The app itself is running fine with google ARC but the USB module doesn't detect any USB device.
I already found that it is possible for Chrome apps to use usb but only when declaring each specific device in the manifest (https://developer.chrome.com/apps/app_usb).
Does Google ARC support USB access?
Will it be possible to get a list with all USB devices without declaring them first in the manifest?
Sorry, ARC does not currently implement a USB service that proxies to the Chrome USB interface.
Feel free to file a bug however.
If we do implement it, is will likely have the same limit where you must predeclare the devices you want access to, for the same reason listed on the page you link to.
Related note: a bug on UsbManager access within ARC was reported: https://code.google.com/p/chromium/issues/detail?id=475419

Android development setup when using USB Host mode

I am a relatively new Android developer but have gotten pretty familiar with the SDK, using LogCat, etc. However, I'm now working on an app (for a Galaxy Tab 7-plus) that utilizes USB Host mode to talk to an external USB device and I've run into an issue.
My question is: What is an ideal environmental setup that will allow me to take advantage of all of the SDK tools (adb, debug, LogCat, DDMS, and so forth) when I am unable to be connected to my PC via USB (since the external USB device my tablet is talking to is using my tab's only USB port)?
Is there an emulator available somewhere (I've searched in vain) that will allow me to simulate USB Host mode using a USB port on my PC?
Do I need to go to some type of on-board logging app?
Is there some kind of 30-pin splitter available so I can connect to both the external device and my PC? (I'm guessing this is impossible, but I'm a hardware idiot... in addition to a run-of-the-mill idiot).
Thanks in advance for your help!
-KR
As I posted in the comments, If the tablet is rooted you can use AdbWireless (Application on the Market)
This can also be done without rooting. Google/Android officially supports this, as described at the bottom of this page:
http://developer.android.com/guide/topics/usb/index.html
But AdbWireless is easier if you are rooted.

USB Android I/O

Is it possible to access the USB port on Android phones? (Droid X for example)
Here is my usage case:
Have a USB device attached to the Android phone. The phone listens for data on this USB device. (The USB device is connected to a USB->RS-232 converter that has I/O attached to it)
This would be slick if possible. Does anyone know if this is possible?
Would be slick, yup. Not possible though. There's a feature request for it: http://code.google.com/p/android/issues/detail?id=738
Actually it is possible on a lot of the phones if you are able to install a new kernel with a USB host driver and rig up a custom cabling scheme to provide usb bus power to the device as the phone won't. A few phones even shipped with this capability already live.
I don't know if the Droid X specifically ships with this already, can have it added (if you are able to flash kernels), could have it added but no one has written the host driver yet, or is missing the hardware capability.
You also would need to enable the appropriate usb serial converter device driver (identified by experimenting with the device on a desktop linux box), but that's probably already in the kernel sources and just needs to be selected in the config. You may also need to create a device file for the /dev/ttyUSB0 or whatever and give it permissions appropriate to the application that wants to access it. (This requires root, but if you can reflash the kernel, you can get root)
If you want to pursue this, search the android kernel google group for posts about USB host mode.
One serious downside to putting the USB into host mode is that you loose the adb interface into the phone, which makes working on your projects hard. You'll probably need to either build an adapter for the low voltage debug serial port if there is one (as on G1, mytouch, etc) so you can get a console shell (or just use that instead of USB to talk to your peripheral) or at a minimum set up an ssh and sftp server on the wifi.
Since you want serial anyway, another option people have used is to get a bluetooth-to-serial module from an outfit such as sparkfun.
A bluetooth to serial adapter might solv your problems.
You can find one at https://www.sparkfun.com/products/582. Boards from other companies are also available for example on ebay.

Categories

Resources