![](/img/trans.png)
[英]How to find Internal(Default Phone Storage ) and External Storage(Removable sd card) in android?
[英]How to find Path of Internal Phone Storage, Personal Data, Internal SD Card, External SD Card and Memory Size?
我是android的初學者。 我想知道如何以編程方式找到android中內部SD卡,外部SD卡,內部電話存儲和個人數據的路徑。 我也想知道如何找到它們的內存大小(已用和可用空間)。
如果可能,請發送信息。 否則發送原因。 請回復您的答案和評論對我很有價值。 謝謝。
File sdCardDirectory = Environment.getExternalStorageDirectory();
This is to find sdcard path
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
return Formatter.formatFileSize(this, availableBlocks * blockSize);
This is to find Internal Phone Storage
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.