Building an android app that will connect to a server that contain a SQL database. How should I do it? [closed]
We don’t allow questions seeking recommendations for books, tools, 开发者_如何学Gosoftware libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this questionI'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!
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.
A free SQL-Server is MySQL. 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).
精彩评论