If you want to connect MS SQL server database with android studio this is your right choice. This tutorial teach you how to connect android studio with MS SQL Database easily. We usually use desktop application and need to see summary result in android application. In that case it’s very important to extract live data from SQL server database to android app.
To perform this task we need to connect MS SQL server with android studio. To practice this tutorial you should have installed java, android studio and SQL server.

Steps are
1. Create and design android app
2. Create MS SQL server database table and insert records.
3. Add java class to connect MS SQL with android studio.
4. Write code in MainActivity. java to display result.
5. Add Jar Dependency in your project library.
6. Add permission in AndroidManifest xml file.
7. Run the app.

You must have enabled TCP IP in SQL Server if TCP IP is being disabled then restart SQL Server Service.
To download .jtds file go to this link

download and install android studio JDK and SDK

Connection con;

public Connection conclass() {
String ip = “”, port = “1433”, db = “mytestdb”, username = “sa”, password = “yourpass”;
StrictMode.ThreadPolicy a = new StrictMode.ThreadPolicy.Builder().permitAll().build();
String connectURL = null;

try {
connectURL = “jdbc:jtds:sqlserver://” + ip + “:” + port + “;databasename=” + db + “;user=” + username + “;”+”password=” + password + “;”;
con = DriverManager.getConnection(connectURL);
} catch (Exception e) {
Log.e(“Error :”, e.getMessage());
return con;

This channel covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, Please subscribe and keep in touch.

Visit my page in Facebook

More Tags
#ConnectMSSQLServerwithAndroidStudio #ConnectAndroidStudiowithSQLServerDatabase #SQLToAndroidStudio

programminggeek,connect android studio with sql server,how to connect android studio with sql server database,connect android studio to database,connect sql database to android studio,connect sql to android studio,connect android studio to sql server,how to connect sql to android studio,connect ms sql server with android studio

By admin

14 thoughts on “How to Connect Android Studio With MS SQL Server Step By Step | ProgrammingGeek”

Leave a Reply

Your email address will not be published.