Android APIs and Android APIs
Android provides me with a lot of APIs. Let's write a little bit about it now.
1. Get the memory size of the mobile phone and the memory size of the SD card
/*** Initialize system data */private void initData () {// obtain the remaining memory for running Rom memory long rom = Environment. getDataDirectory (). getFreeSpace (); // get the remaining memory for running the sd card memory long sd = Environment. getExternalStorageDirectory (). getFreeSpace (); // format the memory display m String romStr = android. text. format. formatter. formatFileSize (MainActivity. this, rom); // format the memory display m String sdStr = android. text. format. formatter. formatFileSize (MainActivity. this, sd );}
To be continued...
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.