Communication between app and server is a much very important task which needs to be carefully handed using a fastest and much efficient library to make this process much easier for even the novice.In this Android Tutorial on Retrofit Library we will learn how to post data into server using this library.


We will be using a local server for this tutorial so if your are not aware of the local server usage and installation please refer below tutorials for any further.


Installation of Local Server || Local Host || Wamp Server Installation


Add Retrofit to your project




Create a simple user interface to insert data, add required fields.


and then lets start coding further

Create a utility file where you can add your api url.

In service class mention your parameters i.e., our key values by using which you want to fetch values

Configuring your retrofit client accordingly

Initialize Service

Now for sending post request using retrofit






PHP Files

Visit this tutorial for creating php based api for this tutorial

Inserting values into MYSQL using PHP




Show Buttons
Hide Buttons
Read previous post:
Installation of Local Server || Local Host || Wamp Server Installation