简体   繁体   English

使用 Cordova 获取 Android 上文件的文件路径

[英]Get filepath of file on Android with Cordova

Is there any way to get the file path of a file on Android, which contains content://... ?有什么方法可以获取 Android 上包含content://...的文件的文件路径?

I saw that there is this plugin https://github.com/hiddentao/cordova-plugin-filepath , but as it has been deprecated, I consider it risky to use a plugin that is no longer supported.我看到有这个插件https://github.com/hiddentao/cordova-plugin-filepath ,但由于它已被弃用,我认为使用不再受支持的插件是有风险的。

We use that plugin in our current project.我们在当前项目中使用该插件。

A lot of Cordova plugins are deprecated.许多 Cordova 插件已弃用。 It's good to be aware of this, but if you limit yourself to plugins that are actively maintained, you are going to have a really hard time with Cordova. I recommend looking at the number of weekly downloads on npm: https://www.npmjs.com/package/cordova-plugin-filepath?activeTab=readme , which is currently +-3500, which is pretty good for a Cordova plugin.意识到这一点很好,但是如果您将自己限制在积极维护的插件上,那么您将很难使用 Cordova。我建议查看 npm 上的每周下载量: https://www。 npmjs.com/package/cordova-plugin-filepath?activeTab=readme ,当前为 +-3500,这对于 Cordova 插件来说非常好。 In the future you might get breaking changes (when you update cordova-android/ios or the targetSDK).将来您可能会得到重大更改(当您更新 cordova-android/ios 或 targetSDK 时)。 But those you can patch with patch package.但是那些你可以用补丁 package 打补丁。

That being said, we are transitioning to react-native, because of some features that we need, that are going to break in 2024, that we cannot repair.也就是说,我们正在过渡到 react-native,因为我们需要的某些功能将在 2024 年损坏,我们无法修复。

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

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