Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: GNU General Public License 

import android.content.Context;

public class Main {
    /**
     * get application directory
     * @param context
     * @return {@link String}
     * @throws Exception
     */
    public static String getAppDataDir(Context context) throws Exception {
        return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).applicationInfo.dataDir;
    }
}