• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Data transfer problem in application

AndDevloper

Lurker
Apr 20, 2010
3
0
Hi Everybody,
I started learning android just a couple of weeks ago, so I am very new to it. I required some help regarding this application that I want to build.
My application is one that requires a data transfer between a client and a server. The client is running on android and the client sends some data at a very frequent rate to the remote server, which then compiles/understands the data so obtained. How can this be implemented very efficiently in android. What kind of classes/resources will be required?

My second question is that does Android have the capability to run on a tablet as of now? If so, how will that happen? Could you please explain a little?

I'll be really grateful if someone could help me out here. I am finding this a little tough and could do with some help here.
Thanks in advance.
 
I've already done a client/server where the client was running on android.
To connect and send data to the server I used the this code:

Socket socket = new Socket();
SocketAddress addr = new InetSocketAddress("200.185.55.52", 9000);
socket.connect(addr);
OutputStream os = socket.getOutputStream();
DataOutputStream dos = new DataOutputStream(os);

You can use 'dos' to write all data that you want to.
Don't forget to close the streams and the socket when you finish to write the data by calling dos.close() and socket.close().
 
  • Like
Reactions: AndDevloper
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones