How data is stored using widgets? For example. I remember your preferences for language, sound, score, etc. a widget application.
Thanks in advance
Printable View
How data is stored using widgets? For example. I remember your preferences for language, sound, score, etc. a widget application.
Thanks in advance
Hello,
See [URL="http://www.google.fi/url?sa=t&source=web&cd=1&ved=0CBYQFjAA&url=http%3A%2F%2Flibrary.forum.nokia.com%2Ftopic%2FWeb_Developers_Library%2FGUID-DF4D8745-B6D4-4BC4-AF2D-0F71F28E9F27.html&ei=cA9mTYbkA8ycOt2vvJUL&usg=AFQjCNGRpjS8tZ2iT7cEM1nNpr1yUCsCLg"]setPreferenceForKey();[/URL]
-Ilkka
I try this but to no avail:
//Store
widget.setPreferenceForKey(longitude, "longitude");
widget.setPreferenceForKey(latitude, "latitude");
//Read
widget.preferenceForKey(longitude, "longitude");
widget.preferenceForKey(latitude, "latitude");
also using JSON but the same result.
// Store objects to local storage
var jsonTasks = JSON.stringify( longitude );
localStorage.tasks = jsonTasks;
var jsonTasks = JSON.stringify( latitude );
localStorage.tasks = jsonTasks;
// Read objects from local storage
longitude = JSON.parse( localStorage.longitude );
latitude = JSON.parse( localStorage.latitude );
Can you show me where did it when wrong?
Thanks in advance.
Hi,
Reading is done by only using the key.
widget.preferenceForKey(String key)
-Ilkka
Thanks a lot :)
Hi
For the full detail chek in library.
[url]http://library.forum.nokia.com/[/url]
Web Developer's Library 2.0 > Symbian Web Runtime API reference > JavaScript widget object
Regards
TJ