app Installed Or Not - Android android.content.pm

Android examples for android.content.pm:App

Description

app Installed Or Not

Demo Code

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class Main{

    public static boolean appInstalledOrNot(Context context,
            String packageName) {
        try {/* w  ww  . j  a va  2 s  . c om*/
            context.getPackageManager().getPackageInfo(packageName,
                    PackageManager.GET_ACTIVITIES);
            return true;
        } catch (PackageManager.NameNotFoundException e) {
            return false;
        }
    }

}

Related Tutorials