Android 2.1 以编程方式卸载 SDCard
我有一个应用程序,它将重要数据写入 SDCard 并使用 AES 对其进行加密,稍后将由桌面应用程序使用。我注意到,如果我不从“设置”菜单中卸载 SDCard,有时文件根本不会写入,或者已损坏。
在 Android 2.1 中是否可以通过编程方式卸载 SDCard?因为我很确定用户有时会忘记这样做,而我将是解决问题的人,我真的不希望这样。
如果这不可能,我应该使用什么 Linux 命令来卸载 SDCard?由于该应用程序将在某些具有 root 操作系统的平板电脑上运行。
I have an application that writes important data to the SDCard and encrypts it using AES, which later will be used by a desktop application. I have noticed that if I do not unmount the SDCard from the Settings menu sometimes the files don't get written at all, or are corrupted.
Is there anyway in Android 2.1 that I can unmount the SDCard programmatically? Because I'm pretty sure that from time to time the users will forget to do this, and I'll be the one fixing the problems and I really don't want this.
If this is not possible,what Linux command should I use to unmount the SDCard? Since the application will run on some tablets that have a rooted OS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
例如,您应该以正确的顺序卸载正在使用 SD 卡的内容,
或者,可能将缓冲区与文件系统同步就足够了
You should unmount what's using the sdcard in the proper order, for example
or, probably synchronizing the buffers with the filesystem would be enough