¿Cómo saber el tamaño de la memoria interna en Android?

Este es mi código,

private String memSize(String path){
    StatFs stat = new StatFs(path);
    long blockSize = stat.getBlockSize();
    long availableBlocks = stat.getAvailableBlocks();
    long freeBlocks = stat.getFreeBlocks();
    long countBlocks = stat.getBlockCount();
    String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
    String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);

    String info = path.toString()
                    + "\nblockSize : " + Long.toString(blockSize)
                    + "\navailableBlocks : " + Long.toString(availableBlocks)
                    + "\nfreeBlocks : " + Long.toString(freeBlocks)
                    + "\nreservedBlocks : " + Long.toString(freeBlocks - availableBlocks)
                    + "\ncountBlocks : " + Long.toString(countBlocks)
                    + "\nspace : " + fileSize + " / " + maxSize
                    + "\n\n";
    return info;
}

Pruebo mi función con la ruta/data y/sdcard y funcion
Pero cuando el camino es/ (Entiendo que es la ruta raíz), este es el resultado.

blockSize: 4096availableBlocks: 0freeBlocks: 0reservedBlocks: 0countBlocks: 0space: 0.00B / 0.00B

Creo que la ruta raíz es el área SuperUser. Puede necesitar algún permiso para acceder.
Mi teléfono ya está rooteado. ¿Podrías mostrarme qué debo hacer en el siguiente paso?

Gracias

Referencias

http: //developer.android.com/reference/android/os/StatFs.htmandroid almacenamiento interno del teléfono

Respuestas a la pregunta(0)

Su respuesta a la pregunta