Local storage in mobile games

Get help using Construct 2

Post » Mon Jul 30, 2012 3:58 pm

Has anyone tried setting up a save system for a CocoonJS export yet. Do the mobile phones remember the save settings on reopening? Do you need to use local storage or is web storage remembered?

Cheers
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Mon Jul 30, 2012 9:58 pm

Local storage should work in CocoonJS, at least in r99.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Mon Jul 30, 2012 11:10 pm

Nice one Ash, great to have you active in the forums!
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Mon Mar 04, 2013 9:54 pm

I just noticed this thread - and even though it's over six months old, this topic is pretty up to date to me ;o) Is there any guide out there explaining how LOCAL storage works? Couldn't find any tutorials on that... And there is only the web storage object, no local storage!? How do you use local storage to get a CocoonJS-compatible export??? ;o)
B
6
Posts: 33
Reputation: 816

Post » Mon Mar 04, 2013 10:10 pm

@TheStoepsel2001

WebStorage = local storage.

https://www.scirra.com/tutorials/266/webstorage-how-to-save-ingame-information

https://www.scirra.com/manual/120/webstorage
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Tue Mar 05, 2013 12:03 pm

@ramones: Thanks for your response. First of all, that sounds good. However, why is it stated in the "Export to CocoonJS"-Tutorial that "The WebStorage plugin's session storage is not available. Use local storage or global variables instead." - That doesn't make sense to me if WebStorage and local storage are both the same, does it!?

How is this passage of the tutorial to be understood?
B
6
Posts: 33
Reputation: 816

Post » Tue Mar 05, 2013 2:17 pm

The Webstorage object itself supports two types of storage: "Session" and "Local".

"Session" is just for the scope of that web page / session.
"Local" is saved on the device until cache is cleared. This is the one you must use for CocoonJS.



B
20
S
6
G
2
Posts: 157
Reputation: 3,109

Post » Tue Mar 05, 2013 5:21 pm

Thanks a lot for clarification!
B
6
Posts: 33
Reputation: 816


Return to How do I....?

Who is online

Users browsing this forum: Radulepy and 5 guests