简体   繁体   English

Android Q 范围存储和外部库

[英]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?如果外部库只接受 java.io.File 或 Android 10 上的文件路径会发生什么? Are all external libraries which didn't use DocumentFile or handle a Uri with the media store, unusable?是否所有不使用 DocumentFile 或使用媒体存储处理 Uri 的外部库都无法使用?

For example: I like to use this library on Android 10 and above: https://github.com/ericfarng/jid3lib例如:我喜欢在Android 10及以上使用这个库: https://github.com/ericfarng/jid3lib

But this library only handles java.io.File or filepath.但是这个库只处理 java.io.File 或文件路径。 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?如果外部库只接受 java.io.File 或 Android 10 上的文件路径会发生什么? Are all external libraries which didn't use DocumentFile or handle a Uri with the media store, unusable?是否所有不使用 DocumentFile 或使用媒体存储处理 Uri 的外部库都无法使用?

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.您始终可以将内容复制到您控制的文件中(例如,在getCacheDir()中),然后使用带有该副本的库。

Also, on Android R (at least through DP3), "raw paths" basically means READ_EXTERNAL_STORAGE works again for accessing external storage .此外,在 Android R(至少通过 DP3)上,“原始路径”基本上意味着READ_EXTERNAL_STORAGE再次用于访问外部存储 So, you may only need to worry about this make-a-copy issue for Android 10.因此,您可能只需要担心 Android 10 的复制问题。

For example: I like to use this library on Android 10 and above: https://github.com/ericfarng/jid3lib例如:我喜欢在Android 10及以上使用这个库: https://github.com/ericfarng/jid3lib

But this library only handles java.io.File or filepath.但是这个库只处理 java.io.File 或文件路径。 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 .由于这个库是开源的,您可以选择制作自己的库副本,该副本可以在InputStream之外运行。 That particular library will be somewhat difficult to modify, as it relies upon RandomAccessFile .该特定库将有些难以修改,因为它依赖于RandomAccessFile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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