- This topic has 5 replies, 3 voices, and was last updated 10 years, 9 months ago by falloffalot.
-
AuthorPosts
-
falloffalotMemberLet’s say I have a simple two page app:
Page 1 shows a members list and page 2 is where the members data is inputted.
When the inputted data is added to page 2 and saved this info clears from page 2 and is permanently visible on page 1.Does anyone know what this kind of function is called?
If anyone has an example code would help me out loads, but I am more than happy to try and figure it out once I know what I need to research!Thanks
BrandonMemberYou would need to use data storage, localStorage, SQLite, IndexDB, or a backend service like php.
Which one really depends on what you are saving and how/who needs to access it.
For example, the first three are stored on the device, so if it needs to be accessed by someone else on a different device you would need a backend server to store it.
If it only needs to be accessed by that person on a single device you can use any of the first three. Each have benefits and limitations. Local storage is the easiest to work with.
Code_AMemberCincy is right, there are a few different options but which one you choose depends on how much data, type of data, and accessibility requirements.
Assuming you have a fair amount of dynamically changing data that you are wanting to be accessed locally then I would probably look into storing in XML or Jason format using the phonegap file API.
If you need this same data to be accessed by different devices then you will need to store the data in a DB on a web server and use AJAX in mobi to retrieve the data from the web. Also as Cincy mentioned, the web end will require a PHP service to grab the data from the DB and return it to mobi.
falloffalotMemberCheers guys.
The information only needs storing on a single device and once inputted and “saved”:The 1st pic is the input page / and the 2nd is the output page
Any help would be really appreciated guys
Code_AMemberIs there a set number of players? If so, then you can use local storage.
If the number of players is unlimited then I would consider storing the data in XML or JSON file on the device.
I have never tried this but maybe you can store an array in local storage. If so, that would be an easier option.
Another option maybe to store the data in JSON formatted string in local storage. Then parse the string into an array on startup and then dynamically build your list. This may be the best option but I have not tested. I think I will play with this and post an example if I get it to work.
falloffalotMemberThanks Code A for the help.
An unlimited amount of players would be ideal but very much doubt there would need to be more than 20 – 30.Edit: hey Cincy Planet have just had a look at your “notepad” widget and that looks like it would virtually the same thing I’m looking for!
I see it’s not for sale yet, when and how much were you thinking?
-
AuthorPosts