android-usb

Android usb host api and USB storage

折月煮酒 提交于 2020-01-12 04:49:27
问题 I am trying to use the android host api for USB storage. I have many doubts regarding same. What all things are possible using host api. I want to see the content of USB and if possible so the normal file operation. I didnt find any documentation help regarding this. I am able to claimInterface using UsbDeviceConnection class API but I'm unable to understand how the bulkTransfer works so if anyone can guide me or give some reference I will try myself. I tried reading the USB specification

Android usb host api and USB storage

那年仲夏 提交于 2020-01-12 04:49:05
问题 I am trying to use the android host api for USB storage. I have many doubts regarding same. What all things are possible using host api. I want to see the content of USB and if possible so the normal file operation. I didnt find any documentation help regarding this. I am able to claimInterface using UsbDeviceConnection class API but I'm unable to understand how the bulkTransfer works so if anyone can guide me or give some reference I will try myself. I tried reading the USB specification

How to grant permission to open usb device with usb manager? openDevice() always returns null

江枫思渺然 提交于 2019-12-19 03:19:45
问题 I want to use a usb device in the following code. It successfully lists the usb devices and iterates over them. In the following code the object "device" is the usbdevice that i need to open. Everything seems Ok except the OpenDevice() method that always returns a null value ! [Activity(Label = "TestApp", MainLauncher = true, Icon = "@drawable/icon")] [IntentFilter(new[] {UsbManager.ActionUsbDeviceAttached})] [MetaData(UsbManager.ActionUsbDeviceAttached, Resource = "@xml/device_filter")]

Prevent USB_DEVICE_ATTACHED launching app after a reboot

谁说我不能喝 提交于 2019-12-11 07:16:06
问题 I have an activity listening for the USB_DEVICE_ATTACHED broadcast intent, which launches when the user plugs in my USB device and selects our app. My problem is the android host devices reboot themselves once a day (usually around 4am), at which point the attached USB_DEVICE_ATTACHED intent is also fired by itself. In this circumstance, I definitely don't want to launch my activity as it doesn't know how to close itself. How can I prevent that from happening? I tried to use the PowerManager

Use libCEC + USB dongle in Android app

天涯浪子 提交于 2019-12-07 01:15:32
问题 My goal is to send HDMI CEC commands from a standard (i.e non-system) app running on an Android box equipped with Pulse-Eight's USB dongle. Following these instructions I successfully managed to compile libcec for Android and execute it as root on the box, with this command: echo <my-cec-command> | cec-client -s /dev/ttyACM0 where /dev/ttyACM0 is the device file created by the system when plugging the dongle. However the permissions of this file prevent the command to be executed by a non

Android list files from USB Drive

倖福魔咒の 提交于 2019-12-05 07:24:52
问题 I currently have a working implementation that allows me to list USB devices, request permission for that USB device and then connect to them (mainly from http://developer.android.com/guide/topics/connectivity/usb/host.html). The code I have is the same as the linked article but none of the methods on the classes provided are for listing files on the device or checking if files exist. However I do not understand how I can list files that are on the USB device to check if files exists before

Use libCEC + USB dongle in Android app

百般思念 提交于 2019-12-05 05:54:00
My goal is to send HDMI CEC commands from a standard (i.e non-system) app running on an Android box equipped with Pulse-Eight's USB dongle. Following these instructions I successfully managed to compile libcec for Android and execute it as root on the box, with this command: echo <my-cec-command> | cec-client -s /dev/ttyACM0 where /dev/ttyACM0 is the device file created by the system when plugging the dongle. However the permissions of this file prevent the command to be executed by a non-root user (therefore it cannot be executed from my Android app). On the other hand the app can actually

Android usb host api and USB storage

人走茶凉 提交于 2019-12-03 07:22:23
I am trying to use the android host api for USB storage. I have many doubts regarding same. What all things are possible using host api. I want to see the content of USB and if possible so the normal file operation. I didnt find any documentation help regarding this. I am able to claimInterface using UsbDeviceConnection class API but I'm unable to understand how the bulkTransfer works so if anyone can guide me or give some reference I will try myself. I tried reading the USB specification also, I understood how bulkTransfer works at USB level but unable to relate how android/java file

How to grant permission to open usb device with usb manager? openDevice() always returns null

泄露秘密 提交于 2019-12-01 08:05:44
I want to use a usb device in the following code. It successfully lists the usb devices and iterates over them. In the following code the object "device" is the usbdevice that i need to open. Everything seems Ok except the OpenDevice() method that always returns a null value ! [Activity(Label = "TestApp", MainLauncher = true, Icon = "@drawable/icon")] [IntentFilter(new[] {UsbManager.ActionUsbDeviceAttached})] [MetaData(UsbManager.ActionUsbDeviceAttached, Resource = "@xml/device_filter")] public class MainActivity : Activity { int count = 1; { base.OnCreate(bundle); // Set our view from the

USB Permissions without prompt

为君一笑 提交于 2019-12-01 01:54:36
问题 I have 2 activities within my app. Say FirstActivity and SecondActivity . FirstActivity is the MAIN and LAUNCHER activity. SecondActivity uses usb devices. I want the prompt for USB permission to appear only once within lifetime of the app. If there was only one Activity, the following lines in manifest solved my purpose: <activity android:name=".FirstActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />