Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Database or App Properties (Mobile)

Hi,

I wanted to know whether it is better to use Titanium.Database or Titanium.App.Properties to store account information. I want to implement that my users can setup and store multiple accounts (username, password, url, …) in my Titanium mobile app. I think no user will store more than five accounts.

Will it be better to create a database (I haven't used databases in Titanium before) to manage these accounts or should I store it as JSON via Titanium.App.Properties?

With better I mean is reading from the storage in database faster? Does the database needs much more resources/memory?

I have to fetch account information each time a user opens a new window.

Does the database module works good or is it a bit buggy / unstable? My app has to work on iOS and Android devices.

As I know both database and Titanium.App.Properties is stored persistent?

Thank you in advance

— asked September 25th 2010 by Jicks Steen
  • database
  • mobile
  • properties
  • storage
0 Comments

2 Answers

  • Accepted Answer

    Definitely Ti.Database if you're using an account system.

    In my mind, Ti.App.Properties is used more for "setting"-typed things. For things that are stored by the user (Such as accounts, passwords, etc.) I would use the in-app database.

    — answered September 25th 2010 by Colton Arabsky
    permalink
    0 Comments
  • Colton, thank you for your answer. I already thought that database will be the better place.

    But I'm a bit afraid when thinking of database updates. As it is not possible to run ALTER sql queries it would be not that simple to handle database migrations. Especially handling upgrades from different versions to the current database version (assuming that a user haven't updated for a long time). I'll have a look whether I can find a good solution for this issue before using the database module.

    — answered September 26th 2010 by Jicks Steen
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.