Click here to Skip to main content
15,867,985 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
Hello developers,

I have a project to do which requires me to send and receive data between a mobile device and a PC. Here is what i want to achieve:
* Have an application on the PC
* Have an application on the Mobile Device

The mobile application sends a simple string e.g. "Hello PC" to the application on the PC and when the PC application gets the message, it sends a response back to the application on the mobile device in a string format e.g. "I got your message, Mobile"

Note that both mobile device and the PC will be connected via USB cable.
I am cluless on this and i have no idea. I have searched all over the internet and i was unable to get a tutorial with examples. Please, i need help on this. I know how to use VB.NET for desktop app and J2ME for mobile. Pls help me!
Posted
Updated 7-Feb-18 0:39am
Comments
Kschuler 8-Sep-14 16:58pm    
Does the information HAVE to pass via the USB cable? Or can you use a web service?
Joeadeoye 9-Sep-14 4:30am    
It has to pass via USB cable. Just the same way nokia mobile phones communicate with PC through Nokia PC Suite via USB cable
[no name] 8-Sep-14 20:02pm    
Simple mobile phone to PC communication is usually done via Bluetooth.

1 solution

First, USB is not a port, it's a bus. You cannot treat it like it is a serial or parallel port. You use the access methods that are exposed by the device driver of the device you're connecting to.

Now I'm going to say something that may confuse you. If the device exposes itself as a serial device then you can talk to the device using normal serial port methods, like over COM1, or whatever port ID the device is setup as.
VB.NET serial port communication[^]
 
Share this answer
 
v2
Comments
Joeadeoye 9-Sep-14 4:25am    
Thank you for your response sir! I read an article that talks about COM like what you said, but i dont seem to figure out how to create the communication with mobile. Here is the link http://janaxelson.com/serial_ports_dotnet.htm and also i got another tutorial on how to connect mobile to PC to exchange data here http://developer.nokia.com/community/wiki/How_to_use_USB_cable_connection_in_Java_ME but all my effort to make it work was in vain

I dont know what to do again. Pls help me
Dave Kreskowiak 9-Sep-14 8:02am    
You have to have an application on the device that also opens a COM port to talk to your application on the PC. Without that, only one side is talking/listening and there's no one on the other end.
Joeadeoye 9-Sep-14 10:42am    
Exactly! that is what i want to achieve. Have applications on both ends (Mobile and PC) and they both should be able to communicate with each other. Please help me out
Dave Kreskowiak 9-Sep-14 12:02pm    
OK, so you're device has to be setup to show itself as a Serial device on it's USB port. I can't tell you how to do that and it has nothing to do with your code. This has to be done in the configuration of the device itself.
Joeadeoye 10-Sep-14 4:16am    
Here is what i want to achieve:

Have a mobile phone (BlackBerry) connected to PC via USB cable through BlackBerry Desktop Manager Software Driver. There will be an application on the mobile, and also an application on the PC. Both applications (Mobile and PC) should be able to send string messages to each other. I have seen applications that do this. An example is an application called "Tether" on BlackBerry App World.

In line with what you said, i.e. setting up device to show itself as a serial device on it's usb port, can the BlackBerry Desktop Manager Software driver do this? I'm sorry for asking this type of question, its just because that i am a novice.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900