Ionic with angular with phonegap with app data historic for calculator


#1

Hi, I apologize, I am new to the subject of ionic, and angular phonegap and I have a question:

I would create a “calculator” type application to calculate a series of data based on formulas, but I wish this app could have a “historical” data, that is, once the user had just fill in the details and implementation he has shown the results, the data stored in any file or database with a date for example and post the user could load them for viewing at a particular moment.

I know mysql web mode and php, but I’ve never work with phonegap + data. I have read enough about sqlite and others but I’m a mess. Also this can work offline? I wish create app in iOS and Android.

Example basic: Calculator 4 + 2 = 6> button to save result (saved with current date)> button upload result (specific date) or listing of historical files

Thanks and excuse my english.
And congratulations on the great framework :slight_smile:


#2

If you want to store data userspecific in a database, you have to consider some authentication service, which is not easy to implement as a beginner.

Phonegap provides a file plugin where you can read/write data.
It is a quick solution for your problem, so you can store the data for the current device on the device itself.

Another approach is to use the localstorage of the webview (you do not need to read/write files on your own.

If you want to store data on a webserver with an own api you need authentication services.
Your app will connect to the API to store and read data in the database.

Greets, bengtler


#3

Hello bengtler, thanks for help me… can you give me a little more information about the plugin file, I think it would be the way to go because as comment, authentication system to beginner mode escapes me.

On the other hand, localStorage require have installed the chrome browser?

Thanks!


#4

I am using

Which has a fallback if html5 localstorage is not available. then it uses Cookies.

Everything you need to know about the file plugin you can find here:
http://docs.phonegap.com/en/3.3.0/cordova_file_file.md.html

You can mount a filesystem for your app - read write and store data only for your app.
http://docs.phonegap.com/en/3.3.0/cordova_file_file.md.html#FileSystem

Greets, bengtler


#5

Thanks for the help!