Questions tagged [android-usb]

Questions regarding the implementation of USB communication on Android through one of the two supported modes: USB accessory or USB host.

Android supports a variety of USB peripherals and Android USB accessories (hardware that implements the Android accessory protocol) through two modes: USB accessory and USB host. In USB accessory mode, the external USB hardware act as the USB hosts. Examples of accessories might include robotics controllers; docking stations; diagnostic and musical equipment; kiosks; card readers; and much more. This gives Android-powered devices that do not have host capabilities the ability to interact with USB hardware.

110 questions
1
vote
1 answer

Example of Android USB Host Asynchronous Bulk Transfer

I am working with Android USB Host mode and would like to perform an asynchronous bulk transfer. I have so far been successfully using synchronous bulk transfers, but am having a little trouble grasping how the pieces come together for an…
Bryce Thomas
  • 10,479
  • 26
  • 77
  • 126
0
votes
0 answers

How to stop automatic audio routing to plugged-in devices in Android 11?

I connected a Bluetooth headset to an Android 11 device and executed the following lines of code audioManager?.isBluetoothScoOn = true audioManager?.startBluetoothSco() audioManager?.mode =…
0
votes
0 answers

Is there a way to stop USB devices from triggering Android activity's pause/resume cycle?

The following is in AndroidManifest.xml for MainActivity:
Hong
  • 17,643
  • 21
  • 81
  • 142
0
votes
0 answers

usb serial android packet loss

I am using com.github.mik3y:usb-serial-for-android. Only some packets reach correctly, some packets lose their length. Sometimes I get a full packet, but usually the response is truncated. And the very first package is correct. private val…
Vsevolod
  • 13
  • 3
0
votes
0 answers

How do I access a json file in a USB pendrive in android with jetpack compose?

I want to read the json file in a pendrive the moment the pendrive is inserted, So, the app should automatically look for the file with a specific name, may be on a specific directory, and display the json content in a textview. No intervention from…
0
votes
0 answers

Camera preview stuck

I'm using the AndroidUSBCamera for connecting with a UVC camera over USB and for some reason the camera preview get freezes sometimes it releases and sometimes it freezes into I restart the app. I think this happened because the buffer is getting…
IdH
  • 41
  • 4
0
votes
0 answers

Read data from USB device

Im tring to read data from a USB device (USB camera that for some reason the CameraManager doesn't recognize). Ive asked for intent for intent and I can establish a connection with the device, but when i try to read data using bulkTransfer but it…
IdH
  • 41
  • 4
0
votes
1 answer

Asking intent to access USB device

I'm trying to read data from a USB device using UsbManager. The device I am trying to read the data from is a camera (but android recognizes it as a USB device) The problem that I currently encountered is that it doesn't let me ask for permission to…
0
votes
1 answer

USB host bulkTransfer returns valid amount of data but I don't get anything back

I have an external camera that's connected via a USB C dongle to my Android tablet. My goal is to have a constant stream of data from the camera into my phone, showing it to the user and allowing him to record it and save it to the local storage. I…
Alon Shlider
  • 1,187
  • 1
  • 16
  • 46
0
votes
0 answers

How to access USB storage without ACTION_OPEN_DOCUMENT_TREE Android

I'm currently making an android application with the intent to copy all files from a USB flash drive onto my tablet. The tablet is to be locked down, disallowing access to all applications other than the application I am making, the tablet is then…
Josh Hunter
  • 45
  • 1
  • 10
0
votes
0 answers

How to communicate with USB devices on Android via studio

I am making an application on an android tablet that is supposed to act as a file backup application, the tablet is going to be locked down and all applications other than the app I am making are to be disabled, the tablet is then to be shipped to…
Josh Hunter
  • 45
  • 1
  • 10
0
votes
2 answers

Android external fingerprint USB always returns false on USB permission

I have problem with Futronic fingerprint usb device on Android 10 & 11. The code intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) always return false when I press the OK button on permission dialog. I have old an android 5 device,…
Lorensius W. L. T
  • 1,734
  • 4
  • 19
  • 31
0
votes
1 answer

Issue with getting USB device permission from BroadcastReceiver?

I am using below code to get usb access permission from user when its detected, but it never get detected in android 11. Any help would be highly appreciated public final String ACTION_USB_PERMISSION = "com.domain.ftd.USB_PERMISSION"; private final…
yamut
  • 135
  • 1
  • 8
0
votes
0 answers

Android AOA. Is FT312 RST pin pulling down == reconnecting USB cable?

I am working on Android AOA project with FT312 chip. There is well known bug in Android where after Andoird app restarting there is a problem with inputstream data flow. Simple solution is to reconnect USB cable but that is not ok for me. The…
0
votes
1 answer

Unable to list the USB connected devices in Android Kotlin

I am building an Android app using Kotlin. What I am trying to do is that I am trying to list down all the devices connected via USB. But the device list is always empty. First I put in the following declaration in the AndroidManifest.xml…
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372