How to remember user input after app closes on android/ios

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

How to remember user input after app closes on android/ios

Post by sms5138 » Thu May 14, 2015 3:41 pm

The title pretty much says it all. I'm wondering what the best (or preferred) method is to remember the users information (for example: what their login information is?) so that they do not have to enter it every time they open the app on their mobile device.

Does anyone have any suggestions on how i might begin to approach this?

My initial thought is to do a SQLlite db, but i'm not sure how that will shake out as i'm already using a mySQL db?

Thanks!

-Sean

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: How to remember user input after app closes on android/i

Post by atout66 » Thu May 14, 2015 3:49 pm

Welcome to the club Sean, I deal with the same as you on the topic <Before preOpenStack> ;-)

May be it can help you to see the page Klauss wrote if you only have one stack to deal with at this adress:
http://newsletters.livecode.com/october ... etter3.php

Good luck, J-P.
Discovering LiveCode Community 6.5.2.

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: How to remember user input after app closes on android/i

Post by sms5138 » Thu May 14, 2015 4:01 pm

Hi!

thanks for the reply! I apologize if this is a silly question, but how would i implement this into my application? would the script look something like this:

Code: Select all

Before preopenstack
---do x, y, and z
end before preopenstack

on preopenstack
--- do a, b, and c
end preopenstack
or am i totally off base on this?

-Sean

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: How to remember user input after app closes on android/i

Post by atout66 » Thu May 14, 2015 5:33 pm

Well I'm not an expert but from the dictionary at the <before> section, they write:
The before handler is exclusive to behavior scripts and is sent to a behavior script before all messages.
It's about behavior which is something I do not understand yet ;-)
So in that case, it seems not to be OK.
Have you read the Klauss web page from the previous link ?
It's well explained and if you have only one stack to deal with, it should be the right place to be.
I don't know anything about mobile applications, but it seems you have to deal with the same problem as me, just in a specific way.
May be by following the topic <Before preOpenStack> you can find some ideas to improve your needs, but if you only have one stack, I would try Klauss method first ?
He provides an example an the code is clear.

HTH, Jean-Paul.
Discovering LiveCode Community 6.5.2.

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: How to remember user input after app closes on android/i

Post by sms5138 » Thu May 14, 2015 6:13 pm

Thanks, this looks great! I'll have to dig into it when i have a bit more time later today!

-Sean

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: How to remember user input after app closes on android/i

Post by sms5138 » Wed May 20, 2015 7:13 pm

Hi Jean-Paul!

Thanks for your help! I got it up and running on my computer!

I was wondering if I would i need to do anything in particular to note that it is a mobile device? I see that the info on the link covered mac, windows, and linux. What should the folder path be for a mobile device, and should it differentiate between android, and ios?

Any information you could provide would be greatly appreciated!

Thank again for all your help.

-Sean

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to remember user input after app closes on android/i

Post by Klaus » Wed May 20, 2015 8:17 pm

Hi Sean,

on mobile (iOS and Android) use -> specialfolderpath("documents") to store any data.


Best

Klaus

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: How to remember user input after app closes on android/i

Post by sms5138 » Thu May 21, 2015 2:24 pm

Klaus,

Thank you for your help! I really appreciate it!

regards,

Sean

Post Reply