pakbull6772540
Posts: 0
Joined: Sun Mar 30, 2014 4:08 pm

Loading button images first time, save to localstorage and reuse next time without re-downloading each time app is start

Currently, I have 10 images assigned to image object that are always there (image buttons). Everytime the app is started, it downloads the images from the appery site.

I would like to use this concept:
Create a db table with all button images in it. When the user first downloads the app, the app will look for a flag and since not set, call a service to download the images to app and store in local storage. Assign them to image objects.

Next time the user starts the app, the button images are loaded from local storage.

Will it work? and how?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Loading button images first time, save to localstorage and reuse next time without re-downloading each time app is start

Hi Pakbull,

Yes, you can implement this.

Best way to do it with Appery.io is the following:

1 Import list service for collection you need.

2 Create generic service and implement it with the following logic:

2.1 If LSV exists - get content from this LSV and return on success event with this content.

2.2 If LSV does not exist - run service from 1st step and when response is returned save it to LSV and return on success event with this content.

Then you will need to map your service to buttons(images) in way you need.

Regards.

Return to “Issues”