Android Open Source - SDCardTrac Storage Helper






From Project

Back to project page SDCardTrac.

License

The source code is released under:

GNU General Public License

If you think the Android project SDCardTrac 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.nma.util.sdcardtrac;
/*  ww w  . ja  va2 s .c  o m*/
import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.util.Log;

import java.io.File;

/**
 * StorageHelper enumerates the available types of storage
 */
public class StorageHelper {
    private static String [] storagePaths;
    private static final String LOG_TAG = "StorageHelper";

    public static String[] getStoragePaths(Context ctx) {
        if (storagePaths == null) {
            File [] files;
            int i = 0;

            files = ContextCompat.getExternalFilesDirs(ctx, null);
            storagePaths = new String[files.length];
            for (File f : files) {
                try {
                    storagePaths[i] = f.getCanonicalPath();
                    Log.d(LOG_TAG, "Adding path to storage list: " + storagePaths[i]);
                } catch (Exception e) {
                    storagePaths[i] = null;
                    Log.w(LOG_TAG, "Error fetching name of storage path[" + i + "]:\n "
                            + e.toString());
                }
                i++;
            }
        }

        return storagePaths;
    }
}




Java Source Code List

com.jjoe64.graphview.BarGraphView.java
com.jjoe64.graphview.CustomLabelFormatter.java
com.jjoe64.graphview.GraphViewDataInterface.java
com.jjoe64.graphview.GraphViewSeries.java
com.jjoe64.graphview.GraphViewStyle.java
com.jjoe64.graphview.GraphView.java
com.jjoe64.graphview.LineGraphView.java
com.jjoe64.graphview.ValueDependentColor.java
com.jjoe64.graphview.compatible.RealScaleGestureDetector.java
com.jjoe64.graphview.compatible.ScaleGestureDetector.java
com.nma.util.sdcardtrac.AlarmHelper.java
com.nma.util.sdcardtrac.BitcoinIntegration.java
com.nma.util.sdcardtrac.ChangeLogFragment.java
com.nma.util.sdcardtrac.DatabaseLoader.java
com.nma.util.sdcardtrac.DatabaseManager.java
com.nma.util.sdcardtrac.DeleteDataPreference.java
com.nma.util.sdcardtrac.DeltaCompute.java
com.nma.util.sdcardtrac.FileObserverService.java
com.nma.util.sdcardtrac.GraphActivity.java
com.nma.util.sdcardtrac.GraphFragment.java
com.nma.util.sdcardtrac.GraphTabListener.java
com.nma.util.sdcardtrac.HelpFragment.java
com.nma.util.sdcardtrac.MyExpandableListAdapter.java
com.nma.util.sdcardtrac.SQLiteHelper.java
com.nma.util.sdcardtrac.SearchableActivity.java
com.nma.util.sdcardtrac.SettingsActivity.java
com.nma.util.sdcardtrac.StorageHelper.java
com.nma.util.sdcardtrac.UsageFileObserver.java