I’ve built some pretty straight forward apps earlier using phonegap for android.
Now i’m building one that will need statusbar notifications from a background service per user.
Using phonegaps backgroundservice plugin, im able to get notifications through the example twitter feed.
getMethod = new
HttpGet(“http://search.twitter.com/search.json?q=phonegap&rpp=1&page1”);
It works as expected, but i’m having big troubles with it.
1 – im not good with json
2 – ive yet to figure out how to store user credentials( user id f.example) on phone.
So lets say i want to build my own json file, myjson.php. in my java class, i cant pass a userid since this is not stored locally, and im unable to fetch it. my httpget would be:
getMethod = new
HttpGet(“http://domain.com/myjson.php”);
Myjson.php would serve me any new messages, so i have to have a way of specifying which user is requesting the file. Concidering it is all through sql, it has to be the same values.
php sessions wont cut it as phones often clears caches and forgets user credentials.
How can i do this? local sql? xml?
And if i manage to store the user credentials locally, how can i add these to my httpget request?
Any help and pointers are greatly appreciated as ive read and read and read and now = stuck.
You can store data locally using LocalStorage. It’s very simple. (Link: https://developer.mozilla.org/en-US/docs/DOM/Storage)