Get Application File Path : Application « Core Class « Android






Get Application File Path

  
//package org.acra.util;

import java.io.File;


import android.content.Context;
import android.content.res.Configuration;
import android.os.Environment;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;

/**
 * Responsible for providing base utilities used when constructing the report.
 * <p/>
 * @author William Ferguson
 * @since 4.3.0
 */
public final class ReportUtils {

    public static String getApplicationFilePath(Context context) {
        final File filesDir = context.getFilesDir();
        if (filesDir != null) {
            return filesDir.getAbsolutePath();
        }

      //  Log.w(ACRA.LOG_TAG, "Couldn't retrieve ApplicationFilePath for : " + context.getPackageName());
        return "Couldn't retrieve ApplicationFilePath";
    }

}

   
    
  








Related examples in the same category

1.Application Widget
2.extends Application
3.Loads the list of installed applications in mApplications.
4.Implementation of the android.app.Instrumentation class, allowing you to run tests against application code.
5.This application demonstrates the seeking capability of ValueAnimator.
6.Creates a file storing a UUID on the first application start. This UUID can then be used as a identifier of this specific application installation.