Alas Licorne
Posts: 0
Joined: Tue Jun 18, 2013 5:52 am

Offline Mobile App with Database

I got an export database from Mysql in Json format with around 800 entries. each data set got 8 colons. The app to built is about to show/display the detail about entry via a search box input. The requierement is that it must work offline.

I've read about echo service but donot get how to work with. Also want to know to prepopulate the database for the first load of the app.

Plz help

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Offline Mobile App with Database

Hello! This link should help http://docs.appery.io/documentation/a.... If you still have any specific questions regarding Echo mode, please let us know. I'll update as for you second question.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Offline Mobile App with Database

If you want to use REST services feature (I mean mapping results to page) it's better to save data in some local storage variable and then use it in generic rest service https://getsatisfaction.com/apperyio/...

Advantage of generic service is that in comparison with Echo is that you can use Request parameters for request, but with Echo mode you'll get all 800 entries. If you don't use mapping and fill the elements on page using JS then it would be enough just work with local storage variable (no need to create Generic service).

2) regarding your question "prepopulate the database for the first load of the app" - if you mean you want to upload all data from DB when app loads first time and then work in offline mode - you can check on page Load event if the local storage variable filled with data then don't do anything, otherwise call service to get data and map received data to local storage.

Alas Licorne
Posts: 0
Joined: Tue Jun 18, 2013 5:52 am

Offline Mobile App with Database

THank for the reply , will work on it and update You

Helen
Posts: 0
Joined: Wed Aug 28, 2013 8:35 pm

Offline Mobile App with Database

Hello, I have a related question.

I also am developing an offline mobile app. I would like to ship my app with a pre-populated database, avoiding the need to 'load' upon first use. How do I do this using Appery?

Thanks!
Helen

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Offline Mobile App with Database

Hello! You can export data in any way to your app. Add this data to the project (for example as a string or array in JS asset) and then while installing app restore them.

Helen
Posts: 0
Joined: Wed Aug 28, 2013 8:35 pm

Offline Mobile App with Database

I would like to include this data in my app as a pre-loaded database as part of installation.

I do not want to have to 'load' or 'restore' the data.

Is there a way to ship or 'bundle' a pre-populated sqlite database ?

Thanks.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Offline Mobile App with Database

Hi Helen,

If you get data outside the Appery.io, you can paste it into a JavaScript asset all the same.

pakbull
Posts: 0
Joined: Wed Sep 25, 2013 10:47 pm

Offline Mobile App with Database

But is this possible with a large set of data? also is there a JS example?

Similar idea as above. Have tables of data and based on input from a user from dropdown1, look up the key value (given by user) and then fetch the related values from the database and populate a dropdown2. When user now selects the value from the dropdown2, lookup the database with both dp1 and dp2 values and populate dropdown3.

The table looks like:
a1, a2, a3
b1, b2, b3
c1, c2, c3
and so on.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Offline Mobile App with Database

You can do anything the browser will support. The app that you create in Appery.io runs in the browser. You can use local storage to save date. You can also consider using IndexedDB (or SQLite) database.

Return to “Issues”