4

I've done developing obb function on my game app. To explain the logic of obb function simply,

  • makes a zip file with assets and rename as .obb.
  • uploads it to play store with apk. then it automatically makes an obb file with build version code.
  • extracts obb file to app data folder with java.util.zip and mount to the assets.

but if do extracting assets, it should require external storage permissions. and it makes 10%~15% loss of customers.

Also lots of posts I've been looking for are saying permission should be needed. but some apps like battlegroundmobile don't request access permission although it uses obb function.

So, I want to know how the apps avoid permission requirement programmatically.

Hyeok
  • 43
  • 4

1 Answers1

1

extracts obb file to app data folder with java.util.zip and mount to the assets.

Maybe that's where your problem is.

Battleground Mobile is not copying or extracting the obb file to Internal Storage. It is accessing the data stream in the file inside the OBB folder. If you just use the file in the OBB folder, you don't need to ask permission for it.

The download size is 1.53 GB. The obb file is in under Internal Storage - Android - obb - com.tencent.ig folder. Its size is 1.53 GB. So the APK size is pretty small.

It downloads an extra 195 MB update data after it starts up. The downloaded files are stored in

/storage/emulated/0/Android/data/com.tencent.ig

Internal Storage - Android - data

which you can access via getExternalFilesDir.

Again, there is no need to ask permission to download into or read that folder.

The total app storage is 1.85GB. App: 1.65 GB Data: 202 MB Cache: 10.59 MB

If you clear data, it will remove all the updates. But the content in the OBB folder remains.

live-love
  • 48,840
  • 22
  • 240
  • 204
  • 1
    `Internal Storage` and `getExternalFilesDir()` is something else. one can only access the app's directory in the `Internal Storage` without asking for permission - contrary to `External Storage`. – Martin Zeitler Sep 09 '18 at 13:44
  • Thanks to your answer! I've understood it. but in my case, I should extract assets from the obb. So I had given a friendly notification about the permission before requesting to decrease loss of customers. :) Thanks again. – Hyeok Sep 10 '18 at 07:29
  • 1
    You don't need to ask permission if you extract your data into your App's data folder, maybe you are extracting your data into another folder. Best wishes on your app. – live-love Sep 10 '18 at 13:39