Requirements for the App1) 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.
Now, Create a new file under layout, named as list_content.xml file and paste following code into it.
Now, Create a class under java and name it as ClassListItems and paste following code into it.
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
Now, Open build app module and add thes two lines there:
Now, Create another java file named as ConnectionClass under your java folder:
Now, Open your MainActivity.java File and add the code below into that file: