Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; public class Main { public static boolean isSystemApp(Context context, String packageName) { boolean isSys = false; PackageManager pm = context.getPackageManager(); try { ApplicationInfo applicationInfo = pm.getApplicationInfo(packageName, 0); if (applicationInfo != null && (applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0) { isSys = true; } } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); isSys = false; } return isSys; } }