简体   繁体   中英

Android Q Scoped Storage and external libraries

What happens if a external library only accept a java.io.File ore a filepath on Android 10? Are all external libraries which didn't use DocumentFile or handle a Uri with the media store, unusable?

For example: I like to use this library on Android 10 and above: https://github.com/ericfarng/jid3lib

But this library only handles java.io.File or filepath. Which options did i have to use it in the future?

I think there are many apps which gets unusable after the changes from Google. Is that right or is there an option for every scenario to maintain the current functions?

What happens if a external library only accept a java.io.File ore a filepath on Android 10? Are all external libraries which didn't use DocumentFile or handle a Uri with the media store, unusable?

You can always make a copy of the content to a file that you control (eg, in getCacheDir() ), then use the library with that copy.

Also, on Android R (at least through DP3), "raw paths" basically means READ_EXTERNAL_STORAGE works again for accessing external storage . So, you may only need to worry about this make-a-copy issue for Android 10.

For example: I like to use this library on Android 10 and above: https://github.com/ericfarng/jid3lib

But this library only handles java.io.File or filepath. Which options did i have to use it in the future?

Since this library is open source, you have the option of making your own copy of the library that can operate off of an InputStream . That particular library will be somewhat difficult to modify, as it relies upon RandomAccessFile .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM