About Http connection

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

About Http connection

Postby ritesh_tyfone » Mon Dec 01, 2008 8:44 am

Hi all, I am new to the Android, can anybody tell me how to make the Http connection to send the data to the server and recieving the response also? Or sample code for the same
ritesh_tyfone
Freshman
Freshman
 
Posts: 4
Joined: Mon Dec 01, 2008 5:54 am
Location: Bangalore

Top

Postby ritesh_tyfone » Mon Dec 01, 2008 8:47 am

I am using the android sdk 1.0.
ritesh_tyfone
Freshman
Freshman
 
Posts: 4
Joined: Mon Dec 01, 2008 5:54 am
Location: Bangalore

Postby MrSnowflake » Mon Dec 01, 2008 10:47 am

It's the same as ordinary java.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby muniraju » Tue Dec 02, 2008 1:14 pm

Get request can done as follows:
DefaultHttpClient httpCleint = new DefaultHttpClient();
HttpGet getReq = new HttpGet("http://<your_url>");

HttpResponse response = httpCleint.execute(getReq);

for posting data to the server you can have a look at the thread http://www.anddev.org/viewtopic.php?p=13027

Regards/
muniraju
Freshman
Freshman
 
Posts: 5
Joined: Fri Nov 21, 2008 8:53 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests