For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 7 replies, 3 voices, and was last updated 13 years, 3 months ago by
Stu Wade.
-
AuthorPosts
-
Stu WadeMemberHi guys,
My WebApp prototype of an intended native iOS iPad App is ‘complete’ – I dare not say finished 🙂
But … There is a minor snag – non-fatal, but somewhat annoying.
Should the user navigate away from my App, they return to the startup page and all captured data is lost.
Q1 – will this behaviour be inherited by the eventual native App?
Q2 – if yes – I assume that to avoid this I need to use Local Storage?
Q3 – if yes – is there a neat ‘capture/restore App state’ API, or will all widget values and global variables have to be dealt with on an individual basis – not hard, but a major PITA.
and finally …
Q4 – what is the event that I need to capture when my App is about to ‘lose focus’?
April 28, 2013 at 6:37 am #338563
Unknown AuthorParticipantSounds like you just need to capture some settings in localstorage and use them to set things when the relevant page is called. Dont make it more complex than it is.
-1TC
April 28, 2013 at 6:56 am #338565
Stu WadeMemberThanks 1tc! Working on a Sunday? Didn’t expect any feedback before the morrow.
The App records and scores a session of Contract Bridge. There is no real reason why a user should leave the App while this is going on, but then users are notoriously fickle.
You are of course correct except that ‘some settings’ could amount to well over a hundred. This will substantially increase my code size for what is essentially a cosmetic benefit.
I have noticed that many Apps seem to restart in the ‘as they were’ state – so was hoping this was going to be an ‘insider trick’ exercise rather than a ‘write fail safe code’ one.
April 28, 2013 at 12:45 pm #338569
Unknown AuthorParticipantI’m not working on Sunday. App development is not my career, it’s my hobby.
There’s no insider trick. I’ve just released an app with 31 settings. So, 31 local storage entries and 31 widget states to set during page transition onto the Settings page.
-1tc
April 28, 2013 at 2:45 pm #338570
paulDMemberHi stu
If your planning on it being a native ios app it will remember your settings. You only need to use local storage with web apps.
Hope that helps
Paul
April 28, 2013 at 4:59 pm #338575
Unknown AuthorParticipantI’m sorry, but that’s not true. For iOS apps, if the app goes out of recently used memory and needs to be reloaded, your settings will vanish.
April 29, 2013 at 2:55 am #338585
paulDMemberOk maybe I’m not getting the local storage thing? But when i exit my apps and re-open it remembers that last page and things like select lists ect…….. Its only when I double click the device round button and delete the app, it resets to start up page?
I do use appcache support though.
Its only when i output a web app its resets every time?
Paul
April 29, 2013 at 6:17 am #338589
Stu WadeMemberThanks a million guys. The behaviour you describe, Paul, is just what I would wish and if the data is persistent until the App is closed – that would be icing on my cake.
Of course, that means there is a need for a ‘Start a new Session’ action, but that is much easier than storing what could be as many as 260 variables.
-
AuthorPosts
