Android examples for App:APK Information
get Package Name from apk file
//package com.java2s; 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 getPackageName(Context context, String filePath) { PackageManager packageManager = context.getPackageManager(); PackageInfo info = packageManager.getPackageArchiveInfo(filePath, PackageManager.GET_ACTIVITIES); if (info != null) { ApplicationInfo appInfo = info.applicationInfo; return appInfo.packageName; }// ww w.j av a 2s .c om return null; } }