0

I want to make an Android application which has both an APK and OBB file inside its own resources. The main point is to create a new folder in Android - obb of the internal storage, and then copy the OBB file from the resources to the newly created folder.

Is this possible, or does Android restrict write access to the internal memory? A yes or no would do, that would greatly help. I have read so many different answers, some say that it is only possible to write to external storage (SD-card).

If it is not possible, is there another way I can do this? The purpose is to automate the process for people who do not know how to properly move an OBB file to Android - obb for a game to work.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • You have access to part of internal storage- your own working directory, which only your app can write to. You do not have access to all of internal storage. – Gabe Sechan Jul 25 '18 at 15:46
  • That was what I thought, so to confirm, I will not be able to write to Android - obb (which is not part of my own application) of the internal storage, @Gabe Sechan? – user9924632 Jul 25 '18 at 16:13

1 Answers1

0

I want to make an Android application which has both an APK and OBB file inside its own resources

This is the tricky part. Probably the answers here can help.

Regarding whether your application can write to internal or external storage. The answer is yes. Check the documentation on how to go about it. Since you need to write to Android obb folder which is in external storage, you would need to request for storage permissions from user.

Bharath Kumar
  • 541
  • 3
  • 10
  • That is why I asked, because the documentation says "Internal storage is best when you want to be sure that neither the user nor other apps can access your files". Does this mean that I cannot write to Android - obb? – user9924632 Jul 25 '18 at 15:51
  • First, clarity is needed about the storages. A good explination is in https://stackoverflow.com/questions/10123812/diff-between-getexternalfilesdir-and-getexternalstoragedirectory Since you want to access Andoird/obb folder which is actually secondary external storage, then you will need to request storage permissions from the user https://developer.android.com/training/data-storage/files#ExternalStoragePermissions I updated my answer with the same. Hope it helps! – Bharath Kumar Jul 25 '18 at 16:01
  • @user9924632 Sorry, in above comment I meant primary external storage, not secondary external storage. – Bharath Kumar Jul 26 '18 at 14:38
  • Thank you for your help, I finally figured it out! – user9924632 Jul 26 '18 at 17:17