Here you can find the source of hasOtherSPAppsInstalled(Context context)
private static boolean hasOtherSPAppsInstalled(Context context)
//package com.java2s; //License from project: Open Source License import android.content.*; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.util.Log; import java.util.List; public class Main { private static final String TAG = "SPAUtil"; public static final String SPA_PACKAGE_PREFIX = "de.danoeh.antennapodsp"; private static boolean hasOtherSPAppsInstalled(Context context) { PackageManager pm = context.getPackageManager(); if (pm == null) { Log.e(TAG, "Unable to get package manager reference"); return false; }//from ww w. j ava 2s . co m List<PackageInfo> packages = pm.getInstalledPackages(0); final String thisPackage = context.getPackageName(); for (PackageInfo otherPackageInfo : packages) { String otherPackage = otherPackageInfo.packageName; if (!thisPackage.equals(otherPackage) && otherPackage.startsWith(SPA_PACKAGE_PREFIX)) { Log.i(TAG, "Found another single purpose app: " + otherPackage); return true; } } return false; } }