如何在程序上打开Android中的SD卡? [英] How to open sd card in android programtically?

查看:92
本文介绍了如何在程序上打开Android中的SD卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在android中的按钮点击事件中打开SD卡

How to open sd card in button click event in android

推荐答案

参见Peter Leow关于存储的优秀文章:在Android上处理输入和存储 [ ^ ]。有关外部存储的部分显示了如何访问/ sdcard目录和文件。
See Peter Leow's excellent article on storage: Handling Input and Storage on Android[^]. The section on External Storage shows how to access the /sdcard directories and files.


实际上Android没有内置的文件资源管理器支持。因此,您必须使用任何第三方文件资源管理器,如Astro,ES等,并使用Intent,您可以在您的应用程序中获取您想要的文件。



您尝试的方式也仅适用于图库中的特定图像。因此它对其他文件格式没有帮助。



但是我建议你只需要通过Android-File-Explorer一个GitHub项目并使用它,它是一个只需要一个文件,你必须包含你的项目及其作为文件资源管理器的工作,你不必使用任何第三方应用程序。
Actually Android doesn't have inbuilt File Explorer support. So for this you have to either use of any third party File Explorer like Astro , ES, etc and using Intent you can get the file which you want in your application.

Also the way you tried is only for specific image from gallery. So it doesn't help you in other file format.

But I recommended you to just go through Android-File-Explorer a GitHub project and use it, its a just one file you have to include your project and its work as a File Explorer and you don't have to use any third party application for this.


这篇关于如何在程序上打开Android中的SD卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆