Android examples for App:App Install
Checks if the target app is installed on the device
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; import android.support.annotation.NonNull; public class Main { /**/*from w ww. j a va 2 s. c om*/ * 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; } } }