where to store my data in appcelerator?

10,551

Solution 1

take a look at the kitchenSink examples, specifically the FileSystem examples

they will demonstrate how to read and write from the local filesystem of the device

filesystem.js in KitchenSink

Solution 2

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

Solution 3

as i see, i think you want to save some data locally right?

actually for me, i keep some simple information in the Ti.App.yourdata

such as


win.js

..... win.name='your name'; Ti.App.name=win.name;

then you can use Ti.App.name for value of win.name anywhere

another way is use Ti.DB

that's local db

sorry if it's not answer you question :p im beginner too

Solution 4

Check out SculeJS, it's a pure JavaScript NoSQL database system designed for use in Titanium, NodeJS, and web based applications. The project is a rewrite of JSONDB.

Share:
10,551
t0s
Author by

t0s

learning 2 code learning Android and Java

Updated on June 22, 2022

Comments

  • t0s
    t0s almost 2 years

    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

  • t0s
    t0s over 13 years
    i used an array ...works and for local and simple data seems a nice solution...thnx!
  • t0s
    t0s about 13 years
    i was working on smthing else and now i saw ur reply, thx a lot i'll check them !!