Download Complete Source Code of the Android Dynamic GridView with MSSQL Server
Requirements for the App
1) Android Studio.2) Microsoft SQL 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 jtds 1.2.7 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, Create another java file named as ConnectionClass under your java folder:
ConnectionClass.java
Now, Open your MainActivity.java File and add the code below into that file: