Download Complete Source Code of the Android Dynamic GridView with MYSQL Server


dunamic GridView android

Requirements for the App

1) Android Studio.
2) MYSQL Server. I have used WAMP SERVER
3) Firewall must allow to connect to database. (or turn off firewall from control panel)
4) Download and add latest version of jtds jar file and include it in your project. See how to include jtds jar file to your project HERE.

Now,first of all create new project in android studio which will create one MainActivity.Java file and one activity_main.xml file. You need to open activity_main.xml file and paste the below code.

activity_main.xml file:

Now, Create a new file under layout, named as list_content.xml file and paste following code into it.


list_content.xml



Now, Create a class under java and name it as ClassListItems and paste following code into it.


ClassListItems.java


Now, you need to download a file named as mysql-connector-3.0.17-ga-bin as I discussed and gave link earlier. Add that file into your project if you have not added so far. After adding that file

Open your AndroidManifest.xml file and add the following permission

AndroidManifest.xml

Now, Open build app module and add thes two lines there:

build.gradle (Module:app)

Now, Open your MainActivity.java File and add the code below into that file:
Remember, you need to change the credentials according to your own database values.

MainActivity.java

Screenshots of the App :


android dynamic GridView