I need help in determining the best cross-browser compatible way of user login "SAVE" and STORE them locally (offline mod) and on the server (online). The program will be used by Android and iOS.
I want to know the best way to track user progress when the device is connected to a network or offline.
Hello, I studied AJAX, JSON, XMLHttpRequest, REST, Java, and HTML5 (specifically localStorage).
Scenario: (Read the book online / offline, save the page)
The user logs in to the web service, and the web service allows the user to load the "html web page page" (view with HTML5 browser).
After each page turn, the REST API uses a GET request to send Progress data to the web server. At the same time, a JSON string is created and stored in a file on the server. (let's say "ProgressData.txt")
In the background, a separate “copy” of the ProgressData.txt file is saved by LOCALLY on the mobile device. The user then leaves the Internet connection and continues to read the HTML book.
When the user reconnects, the ProgressData.txt file is uploaded to the server using the REST API, where he updates the old server file using NEW.txt with all ProgressData users.
Possible solutions:
HTML5 localStorage solution looks good. jQuery even simplifies it: http://plugins.jquery.com/project/html5Storage
Direct Javascript is well suited for server-side storage, however it does not have access to the physical hard drive of the mobile device, which prevents any offline storage.
Java applets look possible. Plus I'm not sure how Java works with Android / iOS.
I do not want to run localhost (PHP / Apache / Python) from mobiledevice every time the user goes offline, however this may be the solution. I came across this powerful tool: http://couchdb.apache.org/
Question:
I need to know the best way to track user progress when the device is connected to a network or offline. What is the best way to do this?
source share