Storing data while processing an app through phonegap - javascript

I am using the Phonegap platform for developing an app and this runs on nexus 5 android 4.
The app is having a user interface through which it takes input from the user and processes it using the Javascript. My question is: Can I store/capture this data somewhere so that I can utilize it later. The utility can be sending the captured data to another server and getting a response from it for the specific data.
What is the best architectural way to accomplish this? Any thoughts highly appreciated.

There are many options to do this, IndexedDB, SQLite, localStorage, sessionStorage which are all HTML5 standards.
You might even be able to use XML file storage to do this.
Its your preference on what works best for you.

Related

How to create a local database using JSON and JavaScript for webapp

I need to develop a simple webapp with a login system, users and data saved to each one of those users, with no knowlege of PHP or Data bases, only HTML, JavaScript/JQuery and JSON.
I must be able to sign up, log in and save some data (it's an online store, i must be able to save purchases historic, list of avourite products, user preferences, etc), all this locally only.
What is the best way to do this?
Security issues are not relevant.
I'm sorry for the bad english, I'm not a native speaker.
Hope you can help me!
You can use localstorage to use it as a db engine, but it is really limited,
You can use IndexedDB to use a localdb for you webapp.
Than will help you yo achieve your goals.
Remember that only moderm browser support IndexedDB, so you can check if your browser support it, else you can send a message for the user, to update the browser or fallback to localstorage
Since you are not using PHP, i would Recommend looking into using Node.js for the server-side part of your app. Node.js is written with javascript, so it will be relatively easy to learn.
On the website, you can use HTML forms to send data to the server using JSON. The other parts of your app can be built using HTML, CSS and javascript.
Although i recommend using SQL, there are other ways to store data like using MongoDB.

Getting Fingerprint template on my website

I am trying to create a E-voting system. So I am trying to to verify user not only based on his/her document but also based on his fingerprint. While searching regarding this topic I came across a solution that suggested me to store the template generated in BLoB format and then later compare it with input.But how do I make a web API like stuff(similar to accessing requests of microphone and camera for eg. while video call over facebook) so that the user need not have a special software, if this is possible then the issue of sending pre-generated templates as input would be solved as it won't store the template in computer but directly sends it to server.
I am totally new to fingerprint.Any help will be greatly appreciated. I am open to further questions and suggestion.
Problems I need to solve:
I need to store , retrieve and compare fingerprint template for the voting system.
Even though I am sending fingerprint template over net it should be safe.
User need not have a special software to scan and send instead if I could request access to fingerprint scanner through browser.
Further suggestions, tips, tricks, etc.
The fingerprint reader with web API is available with CamsUnit. It provides the Javascript based SDK system which helps reading the fingerprints on the browsers. Check the API-Documentation for more information

Access data from webView in cordova/android

I have following situation and didn't find the answer to my question in my searches. I am sorry if I overlooked something.
I am using cordova for an android app. This app isn't more than an existing web page/web application repackaged as an android app. This web application gets data using existing and working api calls in form of http requests.
All good, but this data is only available online. I need to build a local database in android to have the data available offline as well.
Question: How do I access this data and put it into an Activity?
Thank you in advance
You can use localStorage to do that.
https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html
If you want to save a json than you will have to stringify it first.

Database required for standalone application

I am constructing a standalone application that is comprised of HTML, CSS and JS files. The data that is being used by the application is being loaded from an XML file.
I, however, require the application to use a local database - something that would allow me to load, create and edit the data in this database using Javascript. Then package up the application and send it on (I am using webapp-xul-wrapper for this).
Could anybody give me some advice on how I could achieve this? The majority of solutions I have looked at use local storage or only keep the db table data for that particular session or require server side code.
To clarify, my application has a settings page that I would like to allow to edit my data and then keep that data persistent so that when the application is opened again the data is intact. Furthermore, if I was to send the application to someone else - that data would also be intact. Ideally my app would take its data from a physical file that could be passed around.
I hope this question makes sense!
Many thanks,
G.
I actually ended up using a packager called TideSDK (http://www.tidesdk.org/) which supports SQLLite out of the box and also seems to render my applications layout much clearer.
Many thanks!

indexedDb backup in the cloud

I would like my client web app to be able to backup the indexedDb database.
I do not have a webserver
i found this: Exporting and importing IndexedDB data
that says: "you can call an export callback passing the privileged array of objects representing a backup of your object store"
so i have an array of objects in javascript which is my backup...
how can I :
1. turn it to a file?
2. back it up in the cloud?
thank you for your help.
Michael (belgium)
nb: I would love to use dropbox api, i have found this http://code.google.com/p/dropbox-js/source/browse/#svn/trunk but doesn't know if it works ( will try it and let you know).
nb: Also i am planning to use pokki.com to deploy app on client's desktop.
From https://developer.mozilla.org/en-US/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB
Synchronizing. The API is not designed to take care of synchronizing with a server-side database. You have to write code that synchronizes a client-side indexedDB database with a server-side database.

Categories

Resources