How to read PC USB ports in Android emulator? - android-studio

I have a usb device for transmitting data. the device works perfect in windows OS. I am to use the device in Android 13 the Device acts as Human Interface Device.
I am using Android Emulator for programming. It seems the emulator work only for UI and not for external hardware.
And I achived that in android app, It can able to read that pendrive. When I run that app in Emulator it is not detecting.
Can you suggest how can I make Android emulator detect the usb device.
Thank you for your kind interest.
Regards
I want to connect USB device on Emulator.. and need to view that contents.

Related

Debugging BLE HID device

I'm trying to make an Android application for Android Things running on raspberry pi that takes USB joystick inputs (including DJI Mavic controller) and passes it over BLE HID as a gamepad.
Windows, Oculus Quest and Mac all recognize it as a gamepad, but when I try to connect to it, they connect and disconnect right away. I'm not sure why
Is there any tool on any OS that logs the BLE HID pairing process to find out what went wrong?
https://github.com/darvin/USBMavicBLEHIDAndroidThing/blob/master/app/src/main/java/jp/kshoji/blehid/HidPeripheral.java

Debugging apps in Android Studio without using a USB cable at all?

For some reason I am unable to connect my Android phone to PC using a USB cable. I have tried everything from changing cable, updating drivers and even factory resetting the phone but nothing works. Consequently I can not debug in Android Studio. Is there any way to debug(using Bluetooth, WiFi or something else) without using a USB cable at all?
PS: Please do not mark this question as duplicate. I have already read answer to similar questions([one of them is this])1 but the solution suggested there involves using USB cable at least once(for initial setting of debugging via Bluetooth/WiFi). Is there any way that let you debug apps without using a USB cable at all?

Android Device Monitor/DDMS can't connect to device over network

I am trying to debug a memory leak on a Android based VOIP desk phone with Android Studio 2.1 (For what it's worth it's a Grandstream GXV3275 phone, which has a 7in Android tablet embedded in it).
As best I can tell this device has no direct USB connection. I've enabled "Developer Mode" on the phone and am able to connect to it using "adb connect" from the command line. I can use Android Studio to then download and run/debug applications over the network.
But Android Device Monitor will not connect to the device and the phone does not show up in Device Monitor's list of devices. In the Device Monitor's console i see:
[2016-08-30 15:17:32 - DeviceMonitor] Adb connection Error:EOF
[2016-08-30 15:17:32 - DeviceMonitor] Connection attempts: 1
[2016-08-30 15:17:33 - DeviceMonitor] Connection attempts: 2
[2016-08-30 15:17:34 - DeviceMonitor] Connection attempts: 3
Any ideas how to make Device Monitor recognize devices over the network?
Well, the alternative is to use the Android Monitor tab built into Android Studio. This does indeed seem to work without a direct usb tether. Android Monitor supports initiating GC and performing heap dumps (HPROF). The downside that I have seen, is that performing an HPROF dump temporarily disconnects my ethernet connected Android desktop phone from the network.

Can I use a physical phone for debugging in Android Studio wirelessly?

Debugging apps on a physical device (in my opinion) is better than using an emulator.
I was wondering if it's possible connect my phone to my computer via Bluetooth (or wirelessly) without a USB connection.
The wire kind of get in the way sometimes.

My custom usb is recognized as physical keyboard when attached to Sony mobiles

I am developing a product base Android app. That product is behaving absolutely fine in normal Android devices. But behaving bit weird with Sony Xperia mobiles. It is getting recognized as physical keyboard over there. Somehow I successfully detected it when my app is launched manually.
But, the actual requirement is to launch my app as the product is attached to mobile.
Can anyone tell me, why my product is recognized as keyboard instead of normal usb?
Sony Company itself say, they do not guarantee that all usb devices would be supported on Sony devices.
Ref: http://support.sonymobile.com/global-en/xperiaz4tablet/userguide/Connecting-your-device-to-USB-peripherals/
https://support.sonymobile.com/gb/xperiaz3compact/userguide/Connecting-your-device-to-USB-peripherals/
There might be some issue in the code written for your USB device detection. Which might be leading to treat device as physical keyboard by-default.
Ref: Uinput virtual device is detected as physical keyboard on android

Resources