Android MySQL : MultiColumns – Select,Fill ListView [Source]
Android PHP MySQL MultiColumn Select tutorial source code reference
What We Do:
- Connect to MySQL database from android application.
- We use HttpURLConnection as our Networking class.
- We make a HTTP GET Request.
- We use PHP as our server side language.
- PHP selects the data from MySQL and prints it into JSON format.
- Android fetches this JSON and parses it using JSONObject and JSONArray classes from org.json package.
- We then bind this data to a custom ListView.
- Our ListView adapter is BaseAdapter subclass.
- Because this is a networking call,we do it in the background thread using AsyncTask.
- Meanwhile we are showing the progress dialog.
Main Classes :
- MainActivity deriving from support library's AppCompatActivity class.
- Connector class using java.net.HttpURLConnection to connect to network.
- Downloader classes inheriting from AsyncTask.We download in the background thread.
- DataParser class inheriting from Asynctask.We parse using JSONObject and JSONArray in the background thread.
- CustomAdapter deriving from BaseAdapter.Where we bind our data to our custom ListView.
We have this tutorial in the video format in our channel : ProgrammingWizards.
Over there we first show the demo,then explain everything step by step.This is now the source code reference for that particular tutorial.Anyway We shall however convert it to text article in in the near future.If you visit our channel please subscribe so that you never miss our tutorials.We have over 600 video tutorials.
What we do In the Video Tutorial :
- Show Demo of what we are going to build.
- Create MySQL database in Wamp Server.
- Write PHP scripts to connect talk to android over HTTP protocol.
- Write our code in android studio.
- Run the project and see the result.
- Have some coffee if to celebrate.
SOURCE FORMAT :
Platform : Android
Language : Java and XML
Tools : Android Studio
SOURCE CODE REFERENCE :
GITHUB : BROWSE
COMPRESSED ZIP : DOWNLOAD
Website : http://camposha.info;
YouTube Channel : ProgrammingWizards.
FaceBook Page : FB Page