Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old February 4th, 2012, 06:18 AM   #1 (permalink)
New Member
 
Join Date: Feb 2012
Posts: 3
 
Device(s):
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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!!

ankitverma is offline  
Reply With Quote
Sponsors
Old February 4th, 2012, 01:10 PM   #2 (permalink)
Senior Member
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

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.
jonbonazza is online now  
Reply With Quote
The Following User Says Thank You to jonbonazza For This Useful Post:
ankitverma (February 4th, 2012)
Old February 4th, 2012, 11:51 PM   #3 (permalink)
New Member
 
Join Date: Feb 2012
Posts: 3
 
Device(s):
Thanks: 2
Thanked 0 Times in 0 Posts
Default To access data from Db Server in Android Application

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.
ankitverma is offline  
Reply With Quote
Old February 5th, 2012, 11:50 AM   #4 (permalink)
Senior Member
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

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.
jonbonazza is online now  
Reply With Quote
The Following User Says Thank You to jonbonazza For This Useful Post:
ankitverma (February 5th, 2012)
Old February 7th, 2012, 02:01 AM   #5 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 308
 
Device(s): Samsung Galaxy Nexus
Thanks: 0
Thanked 52 Times in 51 Posts
Default

I have done something similar and used this: Connecting to MySQL database | Hello Android
__________________
Android: Personal Storage, Lars Monsen Facts(Norwegian)
miXer is offline  
Reply With Quote
Old February 7th, 2012, 03:03 PM   #6 (permalink)
Senior Member
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

Quote:
Originally Posted by miXer View Post
I have done something similar and used this: Connecting to MySQL database | Hello Android
This is actually the link i generally give to people, but I had lost it when I reformatted my computer. Thanks for "finding" it for me again. :P
jonbonazza is online now  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:26 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo