2016年1月10日 星期日

Get application directory

Reference:

http://stackoverflow.com/questions/5527764/get-application-directory

Code snippet:

PackageManager m = getPackageManager();
String s = getPackageName();
try {
    PackageInfo p = m.getPackageInfo(s, 0);
    s = p.applicationInfo.dataDir;
} catch (PackageManager.NameNotFoundException e) {
    Log.w("yourtag", "Error Package name not found ", e);
}

沒有留言: