Do android apps still need to contain an expansion files downloader?

让人想犯罪 __ 提交于 2019-12-12 13:35:51

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/23520756/do-android-apps-still-need-to-contain-an-expansion-files-downloader

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