Page 1 of 1

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

Posted: Thu May 14, 2015 3:41 pm
by sms5138
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

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

Posted: Thu May 14, 2015 3:49 pm
by atout66
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.

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

Posted: Thu May 14, 2015 4:01 pm
by sms5138
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

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

Posted: Thu May 14, 2015 5:33 pm
by atout66
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.

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

Posted: Thu May 14, 2015 6:13 pm
by sms5138
Thanks, this looks great! I'll have to dig into it when i have a bit more time later today!

-Sean

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

Posted: Wed May 20, 2015 7:13 pm
by sms5138
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

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

Posted: Wed May 20, 2015 8:17 pm
by Klaus
Hi Sean,

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


Best

Klaus

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

Posted: Thu May 21, 2015 2:24 pm
by sms5138
Klaus,

Thank you for your help! I really appreciate it!

regards,

Sean