Home > Net >  Send and receive data from android to server
Send and receive data from android to server

Time:01-19

I am currently coding an android app and I am a novice so it is very complicated for me to do the backend part.The app have to send some data informed in a form to a remote server and receive some data in a datalist too. I have been working on this with tutos and videos for 2 weeks and I did'nt succeed to do that. Is anyone able to send me simple codes (php, java) I can adapt easily to send and receive data?
I am currently working on WampServer and AndroidStudio. I thank you for taking the time to read this and hope you have the solution to my problem!

CodePudding user response:

First of all, your Android app won't be able to call your local server. To be able to communicate with a server, it has to be online. In fact, some solutions should be possible, but needing LOTS of boring configuration. Anyway, once your server is online, have a look at Retrofit lib, which is perfect for web requests.

CodePudding user response:

The most simple way for you is create NodeJs Express server, you can create 'localhost' server and test it, and when ready deploy to 'Heroku' for example.

Take a look on this page: NodeJs Express

Than to talk with this server, use Retrofit2 android library, Here is simple example.

Wish you luck.

  •  Tags:  
  • Related