How to connect Sql Server Database from android app?

Building an android app that will connect to a server that contain a SQL database. How should I do it?

  • I've started building an android app that will connect to a sql server and will take the data from there. I know SQL statements and creating a database etc, but have no experience with sql servers and stuff like this. First of all I need to buy a server, I saw two good companies, I don't know which is better It would be great if you can recommend me (This link is for the basic hosting plan): http://www.cirtexhosting.com/shared.shtml http://www.aplus.net/hosting/personal/ What am I doing after I've bought a server? Building a database using Access or mySql or something and uploading the *.mdb file to the server? I need a free SQL software can you recommend me on something free? After I have a database on a server how can I link it to my android app and using sql statements on it? I know how to use local databases. I'm a little confused as you can see, I hope someone can explain me the proccess step by step, or linking me to a guide. Thanks in advance, Elad!

  • Answer:

    Android apps connecting directly to a DMBS isn't an architecture I'd recommend. Instead, I suggest setting an application on the server (using Java, Rails, whatever) that reads the database and exposes a simple HTTP web service for the Android app to get at the data. Not only is that a more sound architecture, I'm not even sure you can run JDBC drivers in an Android device. Using my architecture, you isolate the device from the structure and type of your database.

Elad92 at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

A free SQL-Server is http://www.mysql.com/. In most cases, it'll already be installed on the Server. Also, most hosting-company's block the port 3306 which MySQL uses, so you'll have to create something that will work as a Handler between your MySQL Database and your Android App. In most cases, you'll want to do this with a Socket-Based Server, which accesses the (for the Server local) MySQL Database and then returns something to your Android app using Sockets. This can be implemented in Java or every other Programming language which supports Sockets (and multi threating if you want a Server for more then one user at a time).

Lukas Knuth

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.