Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I don't fully understand the docs about USB host, or Accessory. I'm not sure which I need. Then there is this talk of serialization and power sources? I'm very confused. Bluetooth is no better.

I just want to send "strings" from my Physical Android device, to an application on my PC.

Can someone link me in the right direction? A tutorial would be awesome.

share|improve this question
What do you mean, send strings? Send strings to some specific listener application? Send a file with some text from one folder to another? – Renan Jun 3 at 17:57
Kind of like a Server, Client socket connection. For example, the Android device sends "Hello", and it is received by a listener on the PC. – Joe Jun 3 at 18:00
You can do this either by putting part of the SDK on the PC and enabling USB debugging (old way) or by having the PC emulate an Accessory mode ADK board (more consistent with intended end-userage but more on your own for implementation). In either case you will end up requiring users to install custom USB drivers. USB Host mode would not apply. – Chris Stratton Jun 3 at 18:06
The second way sounds complicated. I will look around for some references. Thanks! – Joe Jun 3 at 18:14
Couldn't I make my PC a USB Host, and my Android device and Android accessory? – Joe Jun 3 at 18:51

closed as not a real question by 323go, Undo, laalto, Andrea Ligios, Vladimir Jun 4 at 13:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

Check out adb port forward option. Using it you can create a tcp tunnel from your pc to the phone over usb connection (the usb has to be in debug mode).

Take a look at these link for more detail:

http://www.anothem.net/archives/2010/02/15/communicating-over-the-usb-cable/

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

share|improve this answer
Thank you for the links, however, would this be as fast as a Server Client socket connection? The reason I need to use USB or Bluetooth is because I need a faster way to send information from my Device to my PC. – Joe Jun 3 at 20:38
AFAIK its good enough but its just my opinion though. I've used it to run a service on the android and pull data to the desktop for processing and storage. The amount of data being transferred is quite large and is sent every second. So far it works without a hitch. – Srikant Sahay Jun 3 at 21:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.