语言

Menu
Sites
Language
Save string preferenсes

hello
Tell me, please, how can I save the token?
in android I would have enjoyed sharedpreferences, and how to keep the line in the webapp?

it is somehow possible to do it without the file?

响应

6 回复
Fedor Efimenko

localStorage

it works, but when I restarted web simulator, then the data is removed
or is it just a web simulator?

Marco Buettner

mhm... On the web simulator the data are still available until you clear your localStorage or use removeItem. 

On the emulator you data will be removed after reinstall.

Fedor Efimenko

can be when the emulator is closed localStorage is removed?

Marco Buettner

If you just close the emulator and start again... the data should be available... on the Emulator you lose you datas only if you reinstall you application through the SDK.

On the Web Simulator it should always available ...

Marco Buettner

You can use localStorage for saving something.

// save
var token = 'your token';
localStorage.setItem('token', token);

// load
localStorage.getItem('token')

 

Alexander AVSukhov

Hello,

you may use  Widget Interface API.

http://www.w3.org/TR/widgets-apis