where to store my data in appcelerator?

t0s picture t0s · Jan 30, 2011 · Viewed 10.5k times · Source

lets say we want to do a simple app for android and for this app we want some data. Those data when i test my example on my pc locally i have them in a file with json format. lets say that the app doesnt need an internet connection so we cant send a request to a server somewhere.

Now if i move to the android device ( in my case the titanium emulator ) i dont have a server so i can't fetch my json data file.

So whats the secret ? how am i going to do this work ? how all those native apps work with no server, no database, not a way to fetch an xml or json data file ?

thnx

Answer

Bart picture Bart · Feb 3, 2011

This page provides examples of three ways to work with local data: http://wiki.appcelerator.org/display/guides/Working+with+Local+Data

  • Application Properties
  • Filesystem Data
  • Local SQLite database

If you specifically want to work with JSON data, this example should be a huge head start for you: http://wiki.appcelerator.org/display/guides/Working+with+Local+Data#WorkingwithLocalData-StoringJSobjectsasJSONinproperties