Android USB to PC

Put your problem here if it does not fit any of the other categories.

Android USB to PC

Postby dlaroche » Mon Jan 30, 2012 12:56 pm

Hey everyone,

I was wondering if it is possible to link an Android device with a PC via USB so that I can send data back and forth?

Is it possible to code the PC with my own Java program that will gather the data sent by my Android activity?

One other question, is there any easy way to have your Android device appear as a mouse when plugged in to a PC?

Thanks,
Dustin
dlaroche
Junior Developer
Junior Developer
 
Posts: 13
Joined: Fri Sep 16, 2011 6:34 pm

Top

Re: Android USB to PC

Postby Phyll » Mon Jan 30, 2012 2:30 pm

Hi Dustin,

It is not easy to use the usb connection for anything other than a flash drive. On later versions of the OS, v3.2 you have a better chance but the systems were just not set up to use that interface in the first place. They were set up to use the bluetooth and wifi.

It is far easier to use a bluetooth dongle on the PC and adapt the bluetooth chat example for instance. Then you have two way serial communication between the two devices.

For wifi, you could write your PC java application to host its end of a connection over which you could send info back and forth between your phone and the PC. They usually use port 8888 for this. I have also seen a server that you can find on the internet for your phone and then access it with your browser. Since you would have all the code, you could make it do anything you wanted.

Replacing the mouse driver with some kind of driver that would use your phone as an input device is probably not a trivial project. On a version 3.2 phone you might be able to use the usb host api to handle the phone side and then use the Driver Development Kit on the PC to work out a replacement mouse driver. Maybe about the same difficulty as writing a transfer program between two PC's unless you have some source code to use as an example.

If you are thinking of the interface that most users would have access to, it would be the wifi. I think you should pursue that. Using the usb interface will be difficult finding the information you need and short on help. If you do happen to get it going, you should do a tutorial on it because they are in short supply for that interface.

Hope this helps.

Phyll
Phyll
Master Developer
Master Developer
 
Posts: 648
Joined: Fri Oct 14, 2011 11:19 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 17 guests