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
0
votes
0 answers

Unable to use Device Microphone while using the USB web camera in Android

We using the USB web camera in our Android application at the same time we provide the Google Speech to Text conversion feature as well. But we unable to use the Device Microphone while using the USB camera, so please help us how to forcefully…
Thirumoorthy
  • 589
  • 2
  • 11
0
votes
2 answers

Why won't my Broadcast Receiver detect a USB Connection?

I have a Broadcast receiver that is listening for USB connection events in my app. The code is as follows: BroadcastReceiver mUsbReceiver; //Initialized elsewhere void registerMyReceiver() { IntentFilter filter = new IntentFilter(); …
PGMacDesign
  • 6,092
  • 8
  • 41
  • 78
0
votes
1 answer

emulator is not listed in connected usb devices even though the usb debugging is on in android studio

I have enabled developer options and usb debugging mode in my emulator in android studio and it was working very well; it was listed in my connected usb devices and I could select it for running my application. But once I killed the process from…
Zeinab Abbasimazar
  • 9,835
  • 23
  • 82
  • 131
0
votes
0 answers

How to access removable storages such as micro SD card and USB drive?

I have a backup restore app on Google Play. Currently, it allows backing up things on the storage returned by Environment.getExternalStorageDirectory(). But, I want to let the users choose a backup directory, whether it be on SD card, internal…
0
votes
0 answers

Android UsbConnection.bulkTransfer() works but UsbConnection.controlTransfer always returns -1

I'm sending information to an Arduino Nano from an Android device. bulkTransfer returns the correct value (length of data transmitted) but the Arduino receives strange values. I think it is because the baud rate of the Arduino (9600) is different…
0
votes
1 answer

Find and open file in a connected USB

So the logic is: User connects a USB to Android device. User press "Find Update" button. The App connects to the USB and finds in the main folder any .apk file. The App opens the .apk file found in the USB. The .apk runs and update the current…
Sergi U.
  • 1
  • 3
0
votes
0 answers

Read serial port vending machine from Android

Currently I need to be able to read a serial port of a vending machine, I have read about USB host, and I have also found some libraries. My question is: Is it really necessary to use an external library to be able to perform the serial port…
Juanes30
  • 2,398
  • 2
  • 24
  • 38
0
votes
1 answer

How to detected PC connection from an Android Application?

I'm trying to activate USB tethering when i detect a connexion to a linux PC. I already have found the following intent filter : ACTION_POWER_CONNECTED Is there a more specific Intent filter to detect data enabled connections ? If not how can i…
Loïc M
  • 21
  • 1
  • 6
0
votes
1 answer

Send a simple picture through USB Host on Android

I have already tried the program using code snippets on https://developer.android.com/guide/topics/connectivity/usb/host.html I am able to discover the UsbDevice connected, but still have no clue how to establish a connection so that I can pass a…
dcanh121
  • 4,665
  • 11
  • 37
  • 84
0
votes
0 answers

How to get thumbnail of images from USB storage device on Android device?

If USB storage is connected to android device, how can I get thumbnails from images in drive without actually copying image from drive to device?
Praveen Pandey
  • 409
  • 3
  • 20
0
votes
0 answers

Android device boot into the operating system when USB power adapter is plugged in

I would like to have my Android device boot into the operating system when I plug in the USB power adapter. Solutions are available on SO that involve editing "/system/bin/lpm" as shown below. #!/system/bin/sh /system/bin/reboot Variations on the…
0
votes
1 answer

Android app needs permission to read media on usb device

I've creating an android app and I recently updated it. However now the app needs permission to read data from a USB device even though I'm not using it anywhere and it doesn't exist anywhere in my AndroidManifest.xml. The only external libraries…
0
votes
1 answer

Transferring data to USB Device using controlTransfer

Can anyone please explain me clearly about controlTransfer in USB Host mode. What exactly does the parameters mean. I want to know about requestType, requestID, value and index. controlTransfer(int requestType, int request, int value, int index,…
ravi
  • 2,722
  • 7
  • 25
  • 42
0
votes
1 answer

Decoding data from Card reader

I am trying to communicate with a USB Accessory (Magnetic Strip Card reader, Model- E-Seek M250), with a Nexus 7 acting as a USBHost. Use case : When a card is swiped , I need to get the details from the card and convert it to a user readable…
Code_Yoga
  • 2,968
  • 6
  • 30
  • 49
-1
votes
1 answer

Access external USB camera in Android application

Is there any official android library to access external USB camera in android? I have gone through all the android/camera-samples. The issue is external USB camera can not be detected/listed in the below code. val cameraIds2 =…