Skip to content

Unpacking and copying app contents causes app to appear hung #983

@kollivier

Description

@kollivier

We have an app that has a lot of data files, and we support preloading our app on devices without internet access, so the Play restrictions do not apply and furthermore we cannot rely on downloadable asset packs. When the app is first loaded, the unpack and copy of all the app's data files to the /data partition causes the app to appear hung for upwards of 1 minute because the unpack happens in onCreate. Having an app display a blank screen for any real length of time, much less a minute or more, gives a pretty bad first impression.

My understanding is that the technical reason for this process is that fopen and co. will not directly open files on Android because of the need to use AssetManager, so this is worked around by moving all the files to a place where files are directly accessible. I've found another cross-platform app developer who addressed this by devising a drop-in replacement for the fopen series of functions that use the asset manager under the hood.

http://www.50ply.com/blog/2013/01/19/loading-compressed-android-assets-with-file-pointer/#comment-1850768990

Would something like this be an option? Or perhaps a slightly more advanced version that tries the asset manager only for certain paths, or falls back to fopen when that fails? I've spoken with @inclement and others on kivy-dev about this, but I wanted to open a ticket to track this issue as we will really need to get this fixed to continue using p4a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions