views:

471

answers:

4

Hello, I am developing the android application. which is going to update the content from android to the web(php webservice). Can anyone give me the sample code for my reference.

+2  A: 

There are lots of questions already on StackOverflow regarding calling webservices from Android. Try looking at those.

For example:

http://stackoverflow.com/questions/297586/how-to-call-web-service-with-android

http://stackoverflow.com/questions/1264207/how-can-i-call-a-web-service-without-using-ksoap2-in-android

FYI, there should be no difference between a PHP webservice and a webservice written in any other language from the client's (Android's) point of view.

mbaird
A: 

the simpliest way is to use Sockets. :) if there are rest service you can use internal apache library - DefaultClient...

hunterman
A: 

This guide was useful to me in using Android as a REST client. It shows how to use the Android libraries, without external dependencies, to perform basic GET/POST, etc.

Definitely search around if you need more information. There's plenty of resources on the issue.

Magneus
A: 

For this kind of purpose i have recently coded a http client in php scripting which solves your query. It can post the data to the server after that you can save it to the database.

http://webtoocool.wordpress.com/2010/07/30/http-client-pfa/

Webrsk