Search in sources :

Example 1 with InfoCache

use of com.clear.helpers.InfoCache in project AndroidCleaner by ReguloSarmiento.

the class HistoryActivity method espacioDescargas.

public String espacioDescargas() {
    File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
    long tamanoDescarga = 0;
    if (file != null) {
        if (file.listFiles() != null) {
            for (File f : file.listFiles()) {
                if (!f.isDirectory()) {
                    tamanoDescarga += f.length();
                }
            }
        }
    }
    return new InfoCache().calculateSize(tamanoDescarga);
}
Also used : InfoCache(com.clear.helpers.InfoCache) File(java.io.File)

Example 2 with InfoCache

use of com.clear.helpers.InfoCache in project AndroidCleaner by ReguloSarmiento.

the class CacheActivity method iniciarHilo.

public void iniciarHilo() {
    appsList = new ArrayList<InfoApp>();
    app = new InfoCache(this, getPackageManager().getInstalledPackages(0));
    app.setHandler(handler);
    app.start();
}
Also used : InfoCache(com.clear.helpers.InfoCache) InfoApp(com.clear.helpers.InfoApp)

Example 3 with InfoCache

use of com.clear.helpers.InfoCache in project AndroidCleaner by ReguloSarmiento.

the class HistoryActivity method espacioArchivos.

public String espacioArchivos() {
    File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
    long tamanoDescarga = 0;
    if (file != null) {
        if (file.listFiles() != null) {
            for (File f : file.listFiles()) {
                if (f.isDirectory()) {
                    for (File d : f.listFiles()) {
                        tamanoDescarga += d.length();
                    }
                }
            }
        }
    }
    return new InfoCache().calculateSize(tamanoDescarga);
}
Also used : InfoCache(com.clear.helpers.InfoCache) File(java.io.File)

Aggregations

InfoCache (com.clear.helpers.InfoCache)3 File (java.io.File)2 InfoApp (com.clear.helpers.InfoApp)1