Android Open Source - PicoClock File Content






From Project

Back to project page PicoClock.

License

The source code is released under:

GNU General Public License

If you think the Android project PicoClock listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.arighi.picoclock.widget;
//from  w w  w .  ja v  a 2 s .c  om
import java.io.File;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;

import android.util.Log;

public class FileContent extends File {

    private static final String LOG_TAG = "PicoClock";

    public FileContent(String filename) {
        super(filename);
    }

    public String content() {
        StringBuilder text = new StringBuilder();
        try {
            BufferedReader buf = new BufferedReader(new FileReader(this));
            String line;
            while ((line = buf.readLine()) != null) {
                text.append(line);
            }
            buf.close();
        } catch (java.io.IOException e) {
            Log.e(LOG_TAG, "failed to read " + getName());
        }

        return text.toString();
    }
}




Java Source Code List

com.arighi.picoclock.widget.CpuUsage.java
com.arighi.picoclock.widget.FileContent.java
com.arighi.picoclock.widget.MemoryUsage.java
com.arighi.picoclock.widget.PicoClockProvider.java
com.arighi.picoclock.widget.PicoClockService.java