I'm making a story-driven app in Cordova. The problem is that whenever the app relaunches, it restarts the entire story. Is there a way I can set it so as long as the app isn't deleted it saves the exact progress? I haven't found anything online...
Because your Cordova app runs in the browser, you can use browser storage technologies like LocalStorage (basic kind of storage), WebSQL or even the newer IndexedDB. What I personally like to do is to use an abstraction layer like PouchDB (for offline syncing) or localForage.
If you choose to go the WebSQL way and want to store lots of data, consider Cordova plugins for WebSQL.
Related
I have being using typeahead.js in my web application. for those who don't know typeahead is a suggestion library which takes the data from you ajax call and shows its value in a drop down menu like google search engine do. it's quite impressive.
But now I am facing some issue data from ajax call is too heavy so that chrome cache unable to handle such a huge amount data. by going through google. I have found this IndexedDB API.
IndexedDB API which I came to know by googling. It store the data chrome browser offline instead of saving it in cache. please correct me if my understanding is wrong about IndexedDB.
So can I used it to store data client side browser. in my Desktop Web application.
Yes
You may use IndexedDB in your desktop web app, Its recommended especially for storing large JSON's
check out Progressive Web Apps Training Working with IndexedDB
Context: My client-sided web application should work offline and only depend on HTML and Javascript. The target device is a mobile phone with android, but nice would be a solution which works also in Chrome and Firefox. The pictures should be saved locally on the device and available to save them later on a server.
Approach: With getUserMedia i'm able to take a picture and draw it with canvas. Now i'm stucked where i have to save the picture manually. Last approach was to save it in localStorage to access it later.
Question: Is there another way to avoid saving the picture in the localStorage? At least i could accept solutions which exclusively targeting mobile browser for android (maybe jquery, phonegap,... ?)
I'd appreciate your input.
You can use IndexedDB or WebSQL with phonegap to store your image data.
However, first try using HTTP cache. Set long expiry headers, Cache-control: public. If you don't need long-term off-line capability, it will "just work".
These links will help you with IndexedDB and WebSQL:
http://docs.phonegap.com/en/3.3.0/cordova_storage_storage.md.html
http://plugreg.com/plugin/DickvdBrink/cordova-indexeddb
I am new to mobile app development. I am creating cross-platform app using Sencha + Phonegap. My goal is to store user-written text in mobile (offline storage) and some other text data related to it, that would persist even if mobile restarts, which would be then uploaded to server, once mobile has connection.
According to this http://docs.sencha.com/touch/2.3.2/#!/api/Ext.data.proxy.Proxy
Sencha provides 2 client side storages.
LocalStorageProxy - saves its data to localStorage if the browser supports it
MemoryProxy - holds data in memory only, any data is lost when the page is refreshed
MemoryProxy is out of question. And LocalStorage uses HTML5 storage and I dont believe that that lasts after reboot.
So what I need is some kind of database, which will be accessible from Sencha, on both Android and IOS, in offline mode. Is there such a thing?
Your assumption is wrong, localStorage is persistent between applications restarts and application reboots. Are you maybe confusing it with sessionStorage? As far as I know, data will be wiped out only if the user actively clears application data (for example on Android from the application menu).
Anyway, since you are using Cordova/Phonegap, you have these Storage options:
localStorage, key/value persistent storage (support table)
WebSQL, offers more full-featured database tables accessed via SQL queries (Android, BlackBerry 10, iOS, Tizen).
IndexedDB, more features than LocalStorage but fewer than WebSQL (only Windows Phone and Blackberry).
Plus you could use:
filesystem Cordova Api
The localstorage is persistent.
For example in android the localstorage data can only be deleted if the app deletes it, or the app is erased, or if the user goes to the setting and erases the app data for that one particular app.
Hope this helps.
Local storage is persistent. for better implementation you can refer this
:
http://www.sencha.com/blog/creating-an-online-offline-proxy-in-sencha-touch
I need to develop an app for iOS with some basic functionality and since I'm not experienced with Objective C but with Web development, I need to know if it's possible to do it using Phonegap.
This app will be like a book with chapters that needs to be updated on a daily basis.
There'll be a CMS in a server where the content will be updated. Text and pictures.
The app will be running on iPhone and iPad that sometimes may not be connected to the network. When connected they need to check for updates and save in a local database to be available when off-line.
Is this possible using Phonegap?
Is there any local database in iOS like SQLite? Or do I need to store everything in files?
Can we save the text in a database and the pictures somewhere in a folder? Or everything needs to be saved in the local database?
What are the best plugins, features, methods that I'll need to look into?
You can use both LocalStorage and WebSQL in a PhoneGap app. LocalStorage is just... localStorage. Check the MDN docs for it. Ditto for WebSQL.
To begin, I'm sorry for my awful english :)
I have a web application that will communicate frequently with a server running a
webservice offering JSON / XML. The application will send contact details / bills / products, and will have to manage an offline mode.
I thought to use this DOM cache (HTML5). However I must have constantly an updated customer list, bills etc. in offline mode because I can not make a request to the server.
It is therefore necessary to have an xml file on the mobile ... which will be read and modified. Is it possible and not too difficult to manage XML plaintext database with ExtJS (or another framework) on a mobile? (Android)
Thanks.
It's far easier to do with HTML5 storage, which you can use directly without the need for Sencha Touch API calls (providing you're on a supported device, iOS Safari supports web storage).
Have a read of this article from the Sencha blog.
Have a look at Lawnchair - this can be included in your app without a framework.
If you decide to use Sencha Touch you can use localStorage, which allows you to store key/value pairs in the HTML5 Web Storage on the device.
See this tutorial on the Sencha website. You could use localStorage to cache your json feed whilst making static assets available offline with a cache manifest file.