You can use Volley Library to send data to server please Check this Post:- Send data to the server using Volley.

 

 

In this post i explain you how we can POST JSON data to server in android. There are no of ways through which we can send data to server. In this i also explain how we can handle incoming JSON data on server. This simple and easiest way to send data to server i am not using any extra library for this.

Step 1. Create new project in Android Studio/ Eclipse.

Step 2. Open your activity_main.xml inside layout folder and add the following code.

And also Don’t forget to add internet permission to your AndroidManifest.xml

 Step 3. Now open your MainActivity.java in side java folder and add bellow code. In this code we post data to server i am using POST method and create post variable/key {req}  inside this i put JSON note i convert my JSON to string so it will transfer to string.

Step 4. Now when we receive data at server end we need to get object. I am using PHP to get this data.

Done.  🙂