Search code examples
androidexpansion-files

Is Downloader Library required for Android expansion files?


My app requires a lot of image resources, so I've had to package them into an expansion file. I've got this working fine when I manually copy the expansion file to my emulator's shared storage. What's unclear to me is the whole download process.

In Google's (often frustrating) documentation, it says:

On most devices, Google Play downloads the expansion file(s) at the same time it downloads the APK, so your application has everything it needs when the user opens it for the first time. In some cases, however, your application must download the files from Google Play when your application starts.

My app will be free with a single expansion file. Can I actually rely on the expansion file being downloaded with the app? Or must I implement the downloader service to ensure that the expansion file is downloaded when the app starts?

What are the circumstances under which the expansion file would not be downloaded with the apk? I suppose that the user might erase or remove the shared storage volume onto which the expansion file was originally copied, so that might be a case I'd have to worry about.

Tell me I can be lazy! Come on! And then someone link to this question on a blog post lamenting the laziness of app developers. OK, OK, I won't get all defensive. I just want to understand the mechanics here, and yes I would rather avoid the extra headaches of implementing the downloader service. I'm not a full-time Android developer, and I've got other things to do!

Thanks


Solution

  • The play store will attempt to download the expansion files but network connections fail or time out etc

    You should check the files are available when your app starts and manually download them if they are not.

    If you don't allow for this eventuality then some users will be unable to use your app unless it will work without the expansion pack.