3

My question is about the need apps to be able to download expansion files when the app is larger than 50MB and has to make use of them.

According to the Android developer help, applications can rely on expansion files and on newer devices, the expansion files are downloaded automatically before/after the APK, and on "older devices" developers can use a Google-supplied library to manage the download.

However this info has been available for more than two years. Here's an article which cires it: http://www.anandtech.com/show/5629/android-market-app-size-raised-to-4gb-from-50mb If those devices where "old" back then, then they are ancient by now and are probably not in the range of devices my Android app targets.

So which are these old devices that may fail to download the expansion files during install? What is common between them? What is the API level such device might be using? Has anyone experienced an actual need to have a downloader in their app lately (today is 7 May 2014)? Please post as much info as you have about these "old devices" use case, which won't download expansion files during install (and for which just asking the user to reinstall the app wouldn't work).

The reason I am asking is because I would like to avoid adding the java download library (and interface for download) to my app because it's a native app, developed with the Android NDK and it will introduce complexity to the project and the handling of the lifetime and lifecycle of my main native activity.

Maria
  • 633
  • 5
  • 12

2 Answers2

0

It's not just old devices that fail to download, it's any devices - for example if the network dies during the download, or if someone manages to delete the expansion files after they were downloaded.

The docs state:

Download process

Most of the time, Google Play downloads and saves your expansion files at the same time it downloads the APK to the device. However, in some cases Google Play cannot download the expansion files or the user might have deleted previously downloaded expansion files. To handle these situations, your app must be able to download the files itself when the main activity starts, using a URL provided by Google Play.

Thus if you use expansion files at all, you need to handle the case where the files are not currently downloaded.

zmarties
  • 4,809
  • 22
  • 39
  • 1
    In those cases (network lost during install or user removed the files) I would handle by asking them to reinstall the app - which should do just fine to regain the files, unless the network is generally troubled which means my app wouldn't be able to download them either. So I still don't see where the must comes from.. – Maria May 08 '14 at 09:24
  • Asking them to reinstall may also work, but is not very friendly, and sort of assumes your users are more intelligent than the average. The friendly and easily understood thing to do is they start your app, and it handles getting the necessary files automatically; the less friendly way you propose is to get your users to sort out the problem themselves by manually uninstalling (losing any application data) and then installing again - that's quite a complex process and a good proportion of users in that situation will probably simply give up on using your app rather than do that. – zmarties May 08 '14 at 11:24
  • The app in question is a game and all game data will be stored in the cloud as well so no danger of loosing anything during a reinstall. Ofc it's not trivial to reinstall an app, but i can live with this limitation (for the time being) provided it's the ONLY problem which arises. What I need to know is if there is a use cases when reinstall will not work, even though the network connection was fine. – Maria May 08 '14 at 12:30
0

No, you don't need a downloader library.

All you need to do is upload your OBB files (the main OBB file or the main and the expansion files) when you upload your APK in the Google Console website.

So when the user downloads your app, the OBB is part of the APK and gets downloaded and installed in the OBB folder in the device.

Your app file size increases if you don't delete the OBB file. You may want to use it as is, or you may want to extract files from it, and delete it later. But you control the file yourself, and you don't need a file downloader library.

The problem happens with some devices (I can't tell you which ones, but there are some maybe with older Android versions like 5.0) that don't give the user permission to that OBB folder where the obb file is downloaded and copied to, so your app doesn't find that file. There are workarounds around that, such as restarting the app, I don't remember as of now.

I decided to stop using the obb files because some users were complaining about the app size, and started using Dropbox instead to download the files my app needs, after it gets installed. Dropbox is very simple to use, and you can download the files via an url. I haven't had any complains about it since.

live-love
  • 48,840
  • 22
  • 240
  • 204
  • Just to check if I got it right: as of today, if one is using APK expansion files and is targeting *relatively* recent devices, one can assume that Play Store app will download the OBB. This, unless there are network/insufficient space issues while downloading APK and/or OBB. In which case I'm not sure what state you arrive at. – superjos Aug 29 '19 at 16:19
  • Correct, as far as I know, if there is enough space in the device, the Play Store app will download your entire apk (with OBB files). If there is not enough space, the Play Store app will give a message to the user that there is not enough space, and help them free up space. Now if after the app download, during the app install, the space runs out, your app has to check if the OBB files got installed, and if you don't have space to proceed, you need to give the user a message that they need to free up space so you can extract the data from the OBB file (if you need to extract). – live-love Aug 29 '19 at 16:28
  • 1
    If there is a network error, the Play Store app will send a message to their user, the app is not downloaded, they have to redownload it again. They won't be able to install it. Only when it is successfully downloaded you can guarantee that the OBB files got downloaded. – live-love Aug 29 '19 at 16:32
  • whoa, this news comes almost as a lifesaver, there's a whole bunch of threads related to issues with manually downloading OBBs (although many are related to Unity world). Besides, your choice to go with your own storage (Dropbox) sounds interesting as well for futures purposes. If you have any article on that, I'd be interested in reading it. Thanks again – superjos Aug 29 '19 at 16:40
  • 1
    Yes, the whole APK has to be downloaded before they can install the app. I have seem 1GB games, and if there is not enough space during install, they will give the user a message to free up space. But the OBB file is completely downloaded at this point. I only had about 100 MB extra, so DropBox works great. It's pretty straight forward, upload your files to Dropbox, they will get an URL that you can download in your app via HTTP standard Java libraries. – live-love Aug 29 '19 at 16:49
  • 1
    Just a correction: if your app has an update, the entire OBB file gets redownloaded only if you deleted or renamed the OBB file. If you keep it stored in the device the same original way, then it doesn't get redownloaded. – live-love Aug 29 '19 at 17:05
  • Thanks for clarification. Yes, I knew about the update process. Re-reading your 2nd comment, about the issue during the **install** phase (after successful download), so that remain one case where the app can end up being installed, yet not having the OBB in the right place? – superjos Aug 30 '19 at 09:20