Strategy for distribution and management of app with large resources

柔情痞子 提交于 2019-12-11 05:25:30

问题


I'm building an app which requires 1.8GB of resources. It's an enterprise app which will be installed in a controlled environment. The resources need to be on the device from the start as it will be used without network coverage.

The resources are specialist map tiles which are in the form of hundreds of PNG images, contained in semantically relevant folders.

When including these directly in the project, via folder references (as the images are retrieved using a derived path) Xcode slows to a crawl (due to indexing and maintaining a project of that complexity) and installation on a test device takes forever. This can be mitigated by removing the images after the first build (so they are still on the device) but that's not ideal. Additionally, when they're in the project, the bundle size is huge and this causes problems with deployment (not only download times, but it seems to fail quite often when downloading from our internal Apperian app store, presumably due to the sheer size).

I've experimented with distributing the app without the resources and having it download them, if required, on first run as a zip file. Unfortunately unzipping the resources takes an unsustainable amount of time.

How can I hit the sweet spot between an easy-to-manage project in Xcode, a small distribution package, and a manageable first-run experience? I'm happy for the iPad to be sat there for half an hour or so when the app is first installed, but any longer than that is not going to work. Is there a better way than using a zip file for the resources?


回答1:


I've experimented with distributing the app without the resources and having it download them, if required, on first run as a zip file. Unfortunately unzipping the resources takes an unsustainable amount of time.

PNG files are highly compressed, so you do not get a real benefit by zipping them. You could archive them in a tar ball, instead, and unarchiving would be much faster. Maybe, zip has also an archive-without-compression option.

An orthogonal strategy could be, instead of having just one archive, having multiple archives. Then, you could download/unarchive them in a given order so to allow the app to be functional quickly while doing the rest of downloading/unarchiving in background. Whether this is feasible will depend on you app, in the end. Since you say that folders have a semantics, you could archive folders (individually or in groups), then on first launch, ask the user which folder he would like to start working with (if it makes sense), and download that one first.



来源:https://stackoverflow.com/questions/24605770/strategy-for-distribution-and-management-of-app-with-large-resources

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