get internal Storage Folder - Android App

Android examples for App:Local Storage

Description

get internal Storage Folder

Demo Code


//package com.java2s;
import android.content.Context;

import java.io.File;

public class Main {
    private static File getStorageFolder(Context context) {
        // Get external storage folder
        File storageFolder = context.getExternalFilesDir(null);
        if (storageFolder == null) {
            // If failed, get internal storage folder
            storageFolder = context.getFilesDir();
        }/* ww w. j av a2s .  co m*/
        return storageFolder;
    }
}

Related Tutorials