Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.pm.PackageManager; import android.support.annotation.NonNull; public class Main { /** * Checks if the target app is installed on the device * @param context * @param targetPackageName * @return */ public static boolean isAppInstalled(@NonNull Context context, String targetPackageName) { PackageManager pm = context.getPackageManager(); try { pm.getApplicationInfo(targetPackageName, PackageManager.GET_ACTIVITIES); return true; } catch (PackageManager.NameNotFoundException ne) { return false; } } }