I\'ve been looking for a week now... I need some help connecting to a remote database... I want my app to get data out of the database and update the database... I\'ve tried
Easiest way to connect a Mobile (ANDROID, iPhone, Symbian, WP7, you name it) device to a Data Base is to write a HTTP based proxy for your database.
This is:
ANDROID -> HTTP -> APPLICATION SERVER -> DATABASE
And then the other way around to get results:
DATABASE -> APPLICATION SERVER -> HTTP -> ANDROID
In this scenario, you will write a HTTP based application in your favorite language (PHP, Python, Perl, Java, .NET) and deploy it in your favorite Application Server (Apache, Tomcat, IIS) and, in that application you will publish URLs your Android app will access to send/retrieve data to your database.
I think rather than connect to a database remotely, you want to use REST services to get and post data to your remote database.
You can create a REST service to wrap your remote database query and return via http, JSON (which I prefer) or XML.
In your android app you can do an http get or post to consume the aforementioned service
All the best...
You need to have a database back end for your application. There are several options:
Install your own DB (MySQL, Oracle...), and create an HTTP interface for your app to access your data. For example: http://www.example.com/get.php?id=123 to retrieve a data entry from your database. Posting data should be pretty much the same.
You use something like Amazon AWS RDS to host your database, this way you don't need to install a DB server, but you still need to write your own wrapper like above to process the requests from your app.
Or you can use an online database service that has an HTTP API, but you'll have to follow their API. You'll need to find a solution that allows you to define your own schema and objects. Something like Ragic (online spreadsheet style DB) should be in this category.