Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello guys,

i want use window 7 OS,.NET 3.5(Visual Studio 2008) and Android,so i want data transfer between c#.net and android application via usb cable.Actually i don't how and where can start that application.please any body will give some basic ideas..

thanks
Posted

not sure about the usb cable bit - why cant you use wifi ?

Write some code

a) A C# server/service on your windows box that listens for a connection on a particular port, accepts connection, reads the data, intereprets/sends back a response

b) a java 'client' on your Android device - that conenctions to a tcp/ip address & port combination - ie, the address of the c# service/server from (a), that writes some data, and reads the response

on each side (a & b) you can write local test stubs

You should be able to make the code 'channel' independant, so you have an interface to wifi/usb etc

'g'
 
Share this answer
 
I want connect only cable. my lap have not wifi.so only , but ok. give some basic code or basic concepts.
 
Share this answer
 
So broad!

The OSI model (http://en.wikipedia.org/wiki/Osi_model) helps explain the basics of networking, but still, each layer of what goes on in networking can be tough.
The layers go all the way from what you type on your computer (layer 7) to the very wires where information is transmited (layer 1).

I wouldn't recommend you to make a network-based application if you don't know much about networking.



Fortunately, we don't need to program every aspect of the OSI model, the .Net Framework has a lot of classes that help you overlook the low level details (for a reference read Simple Messenger - A C# MSN Messenger-like Chat Application[^]). I'm sure Android has that too, specially since you can use Java.

If the application is to receive data at any given time, then you need to have an open "packet listener" object at both ends (this would be a "server", somewhere always open to solicitations).

Do you need data integrity (no information lost)? Program packets as TCP (Transmission Control Protocol).

Do you not need integrity and can afford to loose some data in transmission (like a TV signal)? Use UDP (User Datagram Protocol). In this case, you need to program packet solicitations in a loop constantly, because UDP is a 1-solicitation-1-packet-sent way to work.


And please, next time narrow things by sharing what you already know about networking.
 
Share this answer
 

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