0

I am creating a php server side with rest services API, but I don't know how to call function register method from android side.

Here is a link to php with REST API that I use. I get Error 404 when using this code.

John_West
  • 2,239
  • 4
  • 24
  • 44
  • Use Google Cloud Messaging for Android. http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ – Volodymyr Kulyk May 06 '15 at 09:19
  • http://stackoverflow.com/questions/29339565/calling-rest-api-from-an-android-app/29339731#29339731 – Yogendra May 06 '15 at 09:20
  • @VladimirKulyk: best not to recommend that link - whacking great SQL injection vulnerabilities. The author seems to have done a better job in the link posted by the OP, but nevertheless I don't recommend this tutorial site. – halfer May 06 '15 at 09:21

4 Answers4

1

There are many ways to call web service whether they are restful or other api. Simple way is to use http Post method using asynctask but which is very well known. Here is link where you will know how to consume those web services https://geekjamboree.wordpress.com/2011/11/22/asynctask-call-web-services-in-android/

But I am suggesting to use android third party library for this. There are 4 to 5 libraries available for use but I personally prefer https://github.com/koush/ion. Which is very easy and handle all kind web services.

Codelord
  • 1,120
  • 2
  • 10
  • 21
0

You have several way to do it. I recomend you RETROFIT.

ElTête
  • 555
  • 1
  • 5
  • 15
0

Try AsyncTask for this work. AsyncTask is used to perform background work.

Gamma
  • 1
0

Check this answer explaining communication between Android, and REST API.

Community
  • 1
  • 1
Paritosh
  • 2,097
  • 3
  • 30
  • 42