Android examples for android.content.pm:Apk Property
get Apk Meta Data
import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; public class Main { public static String getApkMetaData(Context context, String apkPath, String key) { if (context == null || key == null) { return null; }//from w w w . j a v a 2 s . c o m PackageManager pm = context.getPackageManager(); PackageInfo info = pm.getPackageArchiveInfo(apkPath, PackageManager.GET_META_DATA); if (info != null) { ApplicationInfo appInfo = info.applicationInfo; if (appInfo == null || appInfo.metaData == null) { return null; } return appInfo.metaData.getString(key); } return null; } }