检查冰淇淋中是否存在 SD 卡(不支持 SD 卡)
嗯,我读到一些新手机会冰淇淋(4.0),不会有任何 SD 卡。记忆将全部是内部的或类似的东西。不过,至少我读过有关内容,但不可能添加 SD 卡
Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
if(isSDPresent)
{
// yes SD-card is present
}
else
{
// Sorry
}
,但我想如果 SD 卡存在或不存在,则会进行此代码检查。 我想知道设备是否有 SD 卡插槽。 冰淇淋有提供一些相关的 api 吗?
此处没有 SD 卡的手机。
Well I read that some new phones that will ice cream (4.0), will not have any sdcard. The memory will be all internal or something like that. However it is there will not be a possibility to add sdcard at least I read abouth that
Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
if(isSDPresent)
{
// yes SD-card is present
}
else
{
// Sorry
}
But I guess this code check is there if the sdcard is present or not.
I want to foundout if the device have sdcard slot or not.
Does ice cream gives some api about this ?
here phone with no sdcard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
截至我撰写本文时,已经有约 18 个月没有 SD 卡插槽的 Android 设备了。
所有 Android 设备都有外部存储。然而,“外部”意味着“可以通过USB电缆访问”,而不是“可以从设备上物理移除”。
否,它指示外部存储是否可用。在 Android 1.x 和 2.x 设备上,如果用户已将外部存储安装为主机上的驱动器(例如,现在是 Windows 上的 F: 驱动器),则外部存储将不可用于 Android 应用程序。
Android 开发者文档等对此进行了介绍地方。
所有 Android 版本都没有“SD 卡插槽”的概念。
There have been Android devices without an SD card slot for ~18 months, as of the time I wrote this.
All Android devices have external storage. However, "external" means "can be accessed via USB cable", not "can be physically removed from the device".
No, it indicates if external storage is available. On Android 1.x and 2.x devices, if the user has mounted external storage as a drive on a host machine (e.g., it is now their F: drive on Windows), then external storage is not available to Android applications.
This is covered in the Android developer documentation, among other places.
No version of Android has no concept of an "SD card slot".