Persistent data in mobile apps.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 78
- Joined: Wed Apr 10, 2013 9:08 pm
Persistent data in mobile apps.
Hi all.
Have searched for this but not clear in my head, so I thought I would ask the users.
Building mobile app. User has to enter information which is stored when app closes so settings etc are the same when app is next ran. Also for if app closes unexpectedly.
Unsure if SQlite is the way to go or custom properties. Or is there something I missed?
'A shove in the right direction enabling you to learn is always better than being told the answer and not finding out for yourself'.
Have searched for this but not clear in my head, so I thought I would ask the users.
Building mobile app. User has to enter information which is stored when app closes so settings etc are the same when app is next ran. Also for if app closes unexpectedly.
Unsure if SQlite is the way to go or custom properties. Or is there something I missed?
'A shove in the right direction enabling you to learn is always better than being told the answer and not finding out for yourself'.
Returning to try to learn livecode again.
But much greyer at the temples than the last time.
But much greyer at the temples than the last time.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Persistent data in mobile apps.
Here's a simple example of how to save the state of your app by writing to a .txt file in the specialfolderpath("documents")
http://lessons.runrev.com/m/4069/l/1522 ... ile-device
This should lead you in the right direction!
--Sefro
http://lessons.runrev.com/m/4069/l/1522 ... ile-device
This should lead you in the right direction!
--Sefro
-
- Posts: 78
- Joined: Wed Apr 10, 2013 9:08 pm
Re: Persistent data in mobile apps.
Thanks Sefro.
That is exactly what I am looking for. Been building in app inventor for a while and now transferring all programs to Livecode........ and re-writing quite a bit of them as well!!
That is exactly what I am looking for. Been building in app inventor for a while and now transferring all programs to Livecode........ and re-writing quite a bit of them as well!!
Returning to try to learn livecode again.
But much greyer at the temples than the last time.
But much greyer at the temples than the last time.
-
- Posts: 78
- Joined: Wed Apr 10, 2013 9:08 pm
Re: Persistent data in mobile apps.
Now i am further on!!
Would it be better to use sqlite for this? I have information which I need to assemble that will need to be emailed once app has run. (used the tinyDB in app inventor for this in the previous version of this app). It would also hold the persistent data too.
Would it be better to use sqlite for this? I have information which I need to assemble that will need to be emailed once app has run. (used the tinyDB in app inventor for this in the previous version of this app). It would also hold the persistent data too.
Returning to try to learn livecode again.
But much greyer at the temples than the last time.
But much greyer at the temples than the last time.
Re: Persistent data in mobile apps.
Hi Tribblehunter,
I think this depends on how much information you are storing, 5,000 lines of text can open in very little time.
I use both text files and sqlite, I like the text files because it takes very little to view their contents (while debugging). But if the person at the other end of the email is used to getting a db then you should probably stick to sqlite.
You can attach a db to you stack when you deploy your app so you don't have to create it each time and it can already hold values. If you need help on that just ask.
Note: Android Mail has a 5 MB attachment cap on it.
Simon
I think this depends on how much information you are storing, 5,000 lines of text can open in very little time.
I use both text files and sqlite, I like the text files because it takes very little to view their contents (while debugging). But if the person at the other end of the email is used to getting a db then you should probably stick to sqlite.
You can attach a db to you stack when you deploy your app so you don't have to create it each time and it can already hold values. If you need help on that just ask.
Note: Android Mail has a 5 MB attachment cap on it.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 78
- Joined: Wed Apr 10, 2013 9:08 pm
Re: Persistent data in mobile apps.
Now that will work. Email consists of info in email as text (easy to read) and in an attachment to be imported into database.
Good point about text file also. Didn't consider the need to read it easily.
I see busy times ahead!!
Brian
Good point about text file also. Didn't consider the need to read it easily.
I see busy times ahead!!
Brian
Returning to try to learn livecode again.
But much greyer at the temples than the last time.
But much greyer at the temples than the last time.