Search code examples
javaandroidapk-expansion-files

Manually downloaded android obb file, deleted after app update through Play Store


in my app I handle obb extension files download and hosting manually.

I did not upload it in app store, because I use more than one obb files depending on the specific user needs, so I cannot just use a single obb file that is uploaded on play store for the user to download.

I also manage manually obb files rename, so they can be usable for the app, as user can have more than one obb files downloaded and switch between them while app is renaming the obb accordingly.

My issue is, that after a normal update through Play Store, the obb file gets deleted, thus requiring user to re-download it.

I would be happy to know why this is happening or a way to avoid it.

Please note, that I don't have any obb file uploaded on Play Store, because it wouldn't serve my needs. Once user opens the app, chooses appropriate extension to use and then download it through my app.

Thank you!


Solution

  • If your OBB is not downloaded from the Play Store, then I wouldn't stick it in the Play OBB directory. The directory is <shared-storage>/Android/obb/<package-name>/ and the Play store assumes it has a duty to keep this directory clean as part of the update process, so the user isn't left with a bunch of unnecessary OBB files.

    If you want to download the files yourself, and take care of the updates yourself, just put the files in another directory. I'd recommend reading the docs on developer.android.com to help you choose the best location.