Do I need a database?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Do I need a database?

Postby williamzanelli » Thu Apr 09, 2009 2:59 pm

Hi guys,

I have an app, one part of it, reads XML data (from a webserver) and displays it in List View,

Should I have a database locally on the phone to store the data.. or should I call the XML as an wehn I require?

Some pros and cons would be appreciated .

Thanks in advance
Will
williamzanelli
Experienced Developer
Experienced Developer
 
Posts: 63
Joined: Mon Jan 05, 2009 2:37 am
Location: UK

Top

Postby padde » Thu Apr 09, 2009 7:06 pm

The answer greatly depends on what you plan to do with the data in the listview.
If you just load the XML data ones in the app lifetime and dont want to change it
then loading it from webserver is fine. If you plan to load it more than once and/or
change the data in the listview i would hold a copy of the data in a local SQLite DB
on the device. But dont forget to commit the changes to the webserver when the app
is done :wink:

Pros for a local DB solution in case u load the xml data more than once and/or whant to change it in the app are:
- less connections to Webserver
- less traffic
- no long blocking operations on webserver (in case of a multiuser app)
- faster read/edit of xml data on device (because its local)
- no risk of temporary unavailable webserver

Cons
- more code
- not that easy to implement
- u have to take care of webserver and db integrity

Just my 2cent :D


Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby williamzanelli » Tue Apr 14, 2009 6:31 pm

Thanks for the detailed reply.

I'm still not sure if I should use the SQLLiteDB or not.

Will probbaly give the app a go without the DB, see how it handles.. and then use it if the need arises.

Thanks for your thoughts
Will
williamzanelli
Experienced Developer
Experienced Developer
 
Posts: 63
Joined: Mon Jan 05, 2009 2:37 am
Location: UK

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests