Receive Data From Socket on Android

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Receive Data From Socket on Android

Postby binhsoledas » Wed Sep 16, 2009 4:37 am

I create one socket to connect to server to receive data by code:

InputStream in = socket.getInputStream();

after that i use
do {

n = in.read(buffer, 0, length); //to read data in InputStream
}while(n > 0);

But if size of data is sent from server too large, it will receive very slow.

I want to receive more quicklier than by using Thread to read.
I divide data to become some sections, and send us to every thread. But i can't divide data.
I used in.skip(number) to read every section but data is sent from server to be synchronous.
And I read wrong data from server...

Who can read or which method to receive data quicker ?
Thanks
binhsoledas
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Sep 16, 2009 4:16 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 4 guests