Android applications that interact with a device connected to a USB port

I am thinking of an Android application (possibly a companion physical device), and I'm trying to figure out how possible this is.

1) Let's say I connect my Android to my PC. Can I install the application on a PC to communicate with the application running on a cell phone? I just need a very simplified data exchange, it can even be one-way (just the data is transferred from the mobile phone to the application for listening on the PC, when you want a cell phone, I do not need any data sent from the PC to the phone).

When I plug it in, the phone gives me 4 options (charging, floppy drive, HTC sync, snap), which makes me think that this is not feasible, but it’s worth taking a picture anyway.

2) Is it possible for a PC application to talk to the application over the phone in any other way? (Wi-Fi, Bluetooth, etc.). I assume that it is not on wi-fi, since neither side has another IP address (and I want it to be curious, just work, you do not need to enter IP addresses manually manually).

3) If I create a device connected to a small USB port at the bottom of the phone (and even though it's a magic device that can do something, I don’t really care about these details until it’s doable). Can I talk with Android about the Android app?

4) Any other ideas that allow me to talk on the phone with the β€œdevice” that I am making, or with the application on the PC, are more than welcome. Going over the Internet can be an option (although, I believe, there should be a central server that I own as an average person). But I would prefer the connection to be direct between the two devices.

+50
android wifi communication usb
Sep 27 '10 at 12:45
source share
4 answers

The world has changed since this question was asked, and now the answer is the Android Open Accessory Development Kit . This does not solve the problem for existing USB devices, but allows you to create new devices that can use the USB connection of an Android device.

+18
Aug 04 2018-11-21T00:
source share

Communication between an Android device and a PC is possible in yet another way.

Via ADB connection via USB.

  • Port forwarding.
  • JAVA program for Socket Server.
  • Socket Client Android Application.

Through this application, you can communicate with our JAVA program running on a PC.

http://www.anothem.net/archives/2010/10/15/android-usb-connection-to-pc/

+8
Jul 25 '12 at 13:18
source share

Edit: Please note that this answer precedes the availability of host interfaces and Android USB accessories and support found in many devices released after it was written.

If you enable usb debugging on the phone and get something received from the adb sdk (open source) tool on the computer, they will be able to communicate. The PC will need to initiate the connection, but inside the sessions it can be mainly bidirectional or even mainly from the device to the PC. See Developer.android.com for an adb shell and port forwarding. No root is required.

People use bluetooth to communicate with the built-in arduino controllers.

Using root, I made my phone as a usb host, but it was painful because I had to use wifi to get the debug shell, since usb was busy.

Some phones have a low voltage serial port on the extusb connector or audio lines, but you will need to use root and a level switch to do this.

Another idea that I was thinking of making a software modem on the headset jack was apparently made for android and iphone by someone in Japan. This should not require root.

+4
Sep 27 '10 at 13:37
source share

For communication via usb / wlan, look at this project: http://code.google.com/p/android-notifier/

+3
Sep 27 '10 at 12:56
source share



All Articles