Extension files on Android 6

On Android 6 devices, we noticed that now the extension files need us to request WRITE_EXTERNAL_STORAGE permission at run time, which allows the user to refuse, which prevents us from continuing to run the application.

Is there a way to prevent the use of extension files to use WRITE_EXTERNAL_STORAGE or to prevent user failure?

If this request should appear when using extension files, how should we handle it gracefully?

+5
source share
2 answers

I also have this problem. To solve this problem for API 23, I upload the .obb file to the private application directory instead of the obb directory to which my application does not have access. You can view my solution here . Using:

 repositories { maven { url 'https://dl.bintray.com/alexeydanilov/apk-expansion' } } dependencies { compile 'com.danikula.expansion:expansion: VERSION@aar ' compile 'com.danikula.expansion:license: VERSION@aar ' compile 'com.danikula.expansion:zip: VERSION@aar ' } 

See the latest versions here .

0
source
0
source

Source: https://habr.com/ru/post/1238244/


All Articles