電話のメモリの詳細を取得するには
//total
StatFs statF = new StatFs(Environment.getDataDirectory().getAbsolutePath());
float total = ((float)statF.getBlockCount() * statF.getBlockSize()) / 1073741824;
TextView tt = (TextView) ax.findViewById(R.id.total1);
tt.setText(String.valueOf(total)+"GB");
//free
StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath());
float free = ((float)statFs.getAvailableBlocks() * statFs.getBlockSize()) / 1073741824;
TextView t = (TextView) ax.findViewById(R.id.free1);
t.setText(String.valueOf(free)+"GB");
//use
float use = total - free ;
TextView ttt = (TextView) ax.findViewById(R.id.use1);
ttt.setText(String.valueOf(use)+"GB");
私はこのコードを使用していますが、11.350227GB で出力を取得しています。11.35 GB を表示し、1 GB を下回ると MB (つまり 800 MB など) を表示する必要があります。