Android obtains the total capacity of the SD card, available size, total body memory capacity and available size, and androidsd
Public long getSDTotalSize () {/* get the memory card path */File sdcardDir = Environment. getExternalStorageDirectory ();/* StatFs View File System space usage */StatFs statFs = new StatFs (sdcardDir. getPath (); long blockSize = statFs. getBlockSizeLong (); long totalSize = statFs. getBlockCountLong (); return blockSize * totalSize;}/*** get the remaining capacity of the SD card, that is, the size can be * @ return */public long getSdAvaliableSize () {File path = Environment. getExternalStorageDirectory (); StatFs statFs = new StatFs (path. getPath (); long blockSize = statFs. getBlockSizeLong (); long availableBlocks = statFs. getAvailableBlocksLong (); return blockSize * availableBlocks;}/*** get the body memory size * @ return */public long getRomTotalSize () {File path = Environment. getDataDirectory (); StatFs statFs = new StatFs (path. getPath (); long blockSize = statFs. getBlockSizeLong (); long tatalBlocks = statFs. getBlockCountLong (); return blockSize * tatalBlocks;}/*** get available body memory * @ return */private long getRomAvailableSize () {File path = Environment. getDataDirectory (); StatFs statFs = new StatFs (path. getPath (); long blockSize = statFs. getBlockSizeLong (); long availableBlocks = statFs. getAvailableBlocksLong (); return blockSize * availableBlocks ;}
The total size of the SD card displayed on the smart phone is 7967 GB, and the available space is MB.
The prompts for different brands of mobile phones or detection software are different. You can download a 360 optimized master and view your rom in the shortcut settings.
What is the difference between the total size of mobile phone SD card and mobile phone memory?
The SD card is a memory that can be obtained from a mobile phone. Like a SIM card, it is equivalent to a hard disk of a computer. If you want to play a movie, you can put the movie in the SD card, then find your movie on the SD card of your mobile phone. 1G. 2g. 4G. 8g. 16g.