We generally deal with different types of applications where there is a usage for inserting data into MySQL database and retrieving it.

So today i want to show you how to insert values into server.



Right from basic level we will see how to make php files and also database.   Lets start it by creating a database in MYSQL


Now we will see how to code in php to insert details into database but before to that we will connect out code to database with a connector file.   Php folder format AndroidCoding  –>  dbconnect.php, input.php (folder name)                       (php files)



Now using this file we will connect our php file.




Creating activity_main.xml file

Now  we will design a view where user will input details like name, country, email, hobbies.And after entering details a submit button for the form needs to be done.  

So now we have got database, php files for connecting and inserting now we will see java coding.   Now all the details like name, country, email, hobbies into arraylist as below.

Creating async class for inserting values into server.

Creating MainActivity.java file

This is final full coding for inserting details into mysql database.

Output :





Share article on

Show Buttons
Hide Buttons

June 25, 2017

Attention Required! | Cloudflare

One more step

Please complete the security check to access push.wppush.co

Why do I have to complete a CAPTCHA?

Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.

What can I do to prevent this in the future?


If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.

Clear all
Read previous post:
Android Facebook Based Login Tutorial Part – 2