Cordova / Phonegap downloading a lot of images, best possible solution

谁说我不能喝 提交于 2020-02-06 04:42:31

问题


I need some advice. I have Phonegap / Cordova content app created using Ionic Framework. This app is supose to work both offline and online.

So far I managed to implement offline database (SQLite), but I have some trouble with images.

The first strategy I chose was to "install" all the images at the beginning of first start of app (in meanwhile Progress Bar was visible)

It works, but I think that first start of app is simply too slow (it's over 800 images) It takes more than 7 minutes, which is really bad for user experience.

Here are some of my strategies:

  • Download all the images as single ZIP file and extract it into device

  • Download only some part of images (25% ?) and then download rest of them in the background, while user can use his app. Use some kind of images placeholder at some places ?

Which strategy is the best ? Maybe someone has similar experience ?


回答1:


image-saver

An Ionic/Angular directive for saving remote images to local file storage. Might be able to help you out. Make sure to follow the readMe.md file.



来源:https://stackoverflow.com/questions/29344043/cordova-phonegap-downloading-a-lot-of-images-best-possible-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!