Breaking News

How to insert data into MySql Database from Android Application Step 1

This process can be used if you want to develop an App which is not Stand Alone  (access centralized database).
In this post we will understand how to move data from Android App to MySql Database. We are going to use an Android Studio with the help of XAMPP Server which will help to run Server Side Script like Php.
Again, we need a little bit knowledge on how to work with Php and MySql, but don't worry if you don't have that knowledge, this post will give you a light on it.
What to do is installation of Android Studio, XAMPP Server and Text Editor (Notepad++, Sublime Text, Bluefish, etc) on your Machine, after the Installation, follow the Main 5 steps, which will consists a lot of small steps on each.

  1. Create MySql Database
  2. Write Php code to interact with MySql Database.
  3. Develop Simple App to capture Data from the User.
  4. Connect Android App to MySQL Database.
  5. Insert Data to MySQL Database

Note: I'm using Windows OS, Notepad++ and XAMPP Server.

Step 1: Create Database

  • Open your Local Server (Because I'm using xampp, I open xampp)
  • Click Start button to start Apache Server and MySql Server (They are used to execute Php and MySql Commands respectively. Green Color on Apache and MySQL indicate that they are ok)
  • Click Admin button on MySQL. (Your default browser should be opened)
  • On Top Left Corner, Click New
  • Give the Database name. Let us call our Database as Information
  • Complete by Click Create button
  • Now, give a name of the Table and number of columns that it will consists. Let us give a name of table as Student and three (3) number of columns.
  • Complete by Click Go button.
  • Now, give names and some properties (attributes) to your to your columns.
  • Name the columns as Name, Address and Phone.
  • Give the Data Type as VARCHAR (Because we want to store Alphanumeric Data) and Size of 50 (Large enough for the coming data).
  • Complete by Click Save button.
  • Until here, we have create a Database called Information and we have complete one step among the Main 5 Steps explained above. The rest steps will be finished on the coming posts...!!
Please, Comment and Share with your friends!!

Thank you..!!


2 comments: