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
2
votes
1 answer

How to communicate between android device and machine which runs on windows via USB

I am working on one android app where I am trying to establish a communication between android device and machine which runs on windows OS. I want to transfer some bytes from android device to that machine using USB. I believe that machine which…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
2
votes
0 answers

Android - How to use the same USB device with two apps running simultaneously?

I am developing two apps that use the same USB device, but serve different purposes. The USB driver for both apps are the same, however, I would like it to where both apps can be running simultaneously while using the same USB…
Pink Jazz
  • 784
  • 4
  • 13
  • 34
2
votes
0 answers

UIAutomation disconnects with ADB wile running the test caese in Loop

I am getting problem of UiAutomation Not Connected, while running the UiAutomation test cases in loop. AndroidRuntime: FATAL EXCEPTION: Timer-0 AndroidRuntime: Process: com.android.imstressautomation, PID: 13697 AndroidRuntime: …
2
votes
0 answers

Unable to print data from android phone to Usb Printer

I am trying to connect to USB Printer and print data from it. I am using the below code to do this, following things are happening. I start the application from the phone - App opens and shows screen with button labelled "Print". When I attach the…
karan
  • 8,637
  • 3
  • 41
  • 78
2
votes
2 answers

How to receive Intent when USB Accessory is attached if application is already running

I was able to read up here about how to launch my app when a USB accessory is attached, and that much all works fine: I have an IntentFilter built into my manifest which will launch the appropriate activity each time the specified accessory is…
Patrick Grayson
  • 548
  • 3
  • 17
2
votes
3 answers

Adb doesn't detect device after upgrade to Lollipop (Sony Xperia Z3)

Just yesterday my adb was working fine and I was developing my app in peace... Today I updated my xperia z3 to lollipop (auto update from sony)... And the adb stopped detecting the device (on mac os yosemite). What I checked so far: 1) I have the…
akuz
  • 607
  • 7
  • 14
2
votes
0 answers

Security exception in binding service in android from an activity in separate app mentioning permission denial

I have developed a bounded service app in android to get data from a Glucose meter device over USB serial port.I have developed another activity in a different app from where I am launching the service to get data in the activity screen. I am…
2
votes
0 answers

File transfer from Android Device to PC over USB programatically

I am tying to transfer a file from Android device to PC via USB from my App. For this, can any one help me how to transfer the files and communicate with the PC from my Android App.
Mr. N.V.Rao
  • 1,082
  • 13
  • 27
2
votes
1 answer

Android usb host input bulktransfer fails to read randomly when data available

The following code is inside a thread and reads input data coming over usb. Approximately every 80 readings it misses one of the packets coming from an stm32 board. The board is programmed to send data packets to the android tablet every one…
Pablo Valdes
  • 734
  • 8
  • 19
1
vote
0 answers

How to detect USB devices in Android Studio

I'm currently creating an application that aims to automatically move a file between the folder of a USB device and an internal folder. I have the code that moves the files between two folders working on an emulator, however I cannot configure the…
Josh Hunter
  • 45
  • 1
  • 10
1
vote
0 answers

UsbDeviceConnection.requestWait() / UsbRequest.queue() stops communicating with device

Anybody have any ideas as to why requestWait() or queue() might stop receiving information (payloads) from an external device (aggboard) after the device has been disconnected and then reconnected? If I use the bulktransfer() method (which is…
1
vote
0 answers

UsbDeviceConnection.requestWait() Issue - External Device Won't Reconnect

Some background: I have been trying to refactor this Android app's Usb system. Initially, in order to transfer data between endpoints, they used the UsbDeviceConnection.bulkTransfer() method. I refactored it to use the UsbRequest.initialize(),…
1
vote
0 answers

Device Connected To Android Tablet Via USB Becomes Disconnected and When Re-Connected Won't Resume Communication

I am dealing with an issue where a device called an aggregator board (AggBoard for short) becomes disconnected from an Android tablet, and upon re-connection it won't resume communication between endpoints. Some background: I have been trying to…
1
vote
0 answers

why when I am connecting my USB device, this opens my settings above my app

I am trying to connect my USB device to my phone via type-c After creating the connection I get a strange behavior the app opens settings over my app and I have to click back to return my app .. I am using felHR85:UsbSerial library. I test it on…
Zion Aronov
  • 83
  • 1
  • 10
1
vote
1 answer

How to avoid restarting activity automatically , when i testing with plug & unplug usb in power saver mode only

When mobile battery server mode on , testing my app i plug & unplug usb.. app activity restarting.. only with battery server mode on..