androidはsdcardがemulatedかどうかを判断する
最近pmコマンドでシステムのインストーラを使ってapkをsdcardにインストールできないという問題に遭遇し、
Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
主な原因はemulated sdcardがapkをインストールできないため,インストール前にsdcardがemulatedであるか否かを判断する必要がある.この機能システムはapi、Environmentを提供しています.isExternalStorageEmulated();
Returns whether the device has an external storage device which is emulated. If true, the device does not have real external storage, and the directory returned by
Certain system services, such as the package manager, use this to determine where to install an application.
Emulated external storage may also be encrypted - see
Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
主な原因はemulated sdcardがapkをインストールできないため,インストール前にsdcardがemulatedであるか否かを判断する必要がある.この機能システムはapi、Environmentを提供しています.isExternalStorageEmulated();
Returns whether the device has an external storage device which is emulated. If true, the device does not have real external storage, and the directory returned by
getExternalStorageDirectory()
will be allocated using a portion of the internal storage system. Certain system services, such as the package manager, use this to determine where to install an application.
Emulated external storage may also be encrypted - see
android.app.admin.DevicePolicyManager.setStorageEncryption(android.content.ComponentName, boolean)
for additional details.