是否所有的Andr​​oid设备都内置SD卡?有的、设备、oid、Andr

2023-09-04 03:45:11 作者:未轻叹

在我的应用程序第一次运行时,我下载一个pretty的大文件/ SD卡/

我已经知道这会失败,如果用户的手机内置SD卡已满,或者未安装(例如,如果手机连接到PC作为大容量存储设备,或者未从电脑正常断开)。

但有没有内部SD卡上的任何Android设备? (上我的应用程序肯定是无法使用)

解决方案   

但有没有内部SD卡上的任何Android设备? (上我的应用程序肯定是无法使用)

这有Android市场将会有应至少2GB的 Environment.getExternalStorageDirectory任何设备()。这是否是一个SD卡或别​​的东西会因设备而异。

On the first run of my app, I am downloading a pretty big file to /sdcard/

I already know this can fail if the internal SD card of the user's phone is full or not mounted (e.g. if the phone is connected to a PC as a mass storage device, or has not been properly disconnected from a PC).

But are there any android devices with NO INTERNAL SD CARD ? (on which my app would definitely be unusable)

解决方案

But are there any android devices with NO INTERNAL SD CARD ? (on which my app would definitely be unusable)

Any device that has the Android Market will have at least 2GB of storage at Environment.getExternalStorageDirectory(). Whether that is an SD card or something else will vary by device.