• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android Application Database Maintainence

Hi All,

Please can anyone answer my 2 questions:

1)I want to build an Android app with a database table of 1000-2000 records.Please can anyone guide how this can be done, How I can build table with all data inserted.

2)Later if I want to update my database table with 500 more records what is the procedure to do it.

Please note the insertion/Updation of data is not to be done programtically by Sqllite in the code rather by the creator of the app himself

Thanks for any reply in advance!! :)
 
1) You really have two options here: (a) add the database to the APK and make it local to the user's device or (b)upload the database to a database server and access the same DB from all Users' devices remotely. If the databsae will be different for each user, and you don't have any need to monitor them, then it probably makes more sense to just go with option (a). If the database is common to all users or you have a need to monitor it for some reason, then option (b) is probably your best bet.

2) For maintaining and updating databases, option (a) can only be updated by issuing an application update containing the new version of the DB. option (b) is a bit easier as you simply need to update the database online and you only need to update the application if you make some sort of major change to the DB, such as adding a new table, or renaming a field or table.
 
Hi Thanks again for your reply, Now I am clear that I have to go with option b (Keeping a common database so that all devices can access it).Just a quick question: Is the programming of android application done using SqlLite to access the database on server.
Can you please provide any reference link for any study material on this (how to access database on DB-server from android application) or suggest any book, I will be very great full to you.
 
Unfortunately I don't have any links on hand, but some Googling should get you what you need.

Since you will be accessing a database from a web server and that database won't be SQLite, you can't really use the SQLite apis. What you need to do is create a PHP script that performs all the database querying and such and then print the result in JSON. In your Android client application, you then grab that JSON string using a DefaultHttpClient or similar API to access the PHP script. Once you have the JSON string in hand, it's a simple matter of converting it to an array of JSONObjects and handling them appropriately.
 
Back
Top Bottom