Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;
import android.os.Environment;

public class Main {
    private static final String DATA_SDCARD_ROOT = "/data/sdcard";
    private static final String LEAF_DCIM_SCREENSHOTS_FILE_PATH = "/DCIM/Screenshots";
    public static String LEAF_CAMERA_FILE_PATH;

    private static ArrayList<String> getAllSpecialFilePath() {
        ArrayList<String> result = new ArrayList<String>();
        result.addAll(getAllSDCardCameraFilePath());
        result.addAll(getAllSDCardScreenshotsFilePath());
        return result;
    }

    public static ArrayList<String> getAllSDCardCameraFilePath() {
        return getAllSDCardFilePath(LEAF_CAMERA_FILE_PATH);
    }

    public static ArrayList<String> getAllSDCardScreenshotsFilePath() {
        return getAllSDCardFilePath(LEAF_DCIM_SCREENSHOTS_FILE_PATH);
    }

    public static ArrayList<String> getAllSDCardFilePath(String leafFolder) {
        ArrayList<String> result = new ArrayList<String>();
        //TODO tfling
        /*
        if (Build.IS_HONGMI) {
        result.add(getDataSDCardRoot() + leafFolder);
        result.add(getInternalSDCardRoot() + leafFolder);
        result.add(getExternalSDCardRoot() + leafFolder);
        } else {
        result.add(getDataSDCardRoot() + leafFolder);
        result.add(getMainSDCardRoot() + leafFolder);
        }
         */
        result.add(getDataSDCardRoot() + leafFolder);
        result.add(getMainSDCardRoot() + leafFolder);
        return result;
    }

    public static String getDataSDCardRoot() {
        return DATA_SDCARD_ROOT;
    }

    public static String getMainSDCardRoot() {
        return Environment.getExternalStorageDirectory().getPath();
    }
}