Check if app Installed Or Not - Android App

Android examples for App:App Install

Description

Check if app Installed Or Not

Demo Code


//package com.java2s;
import android.content.Context;

import android.content.pm.PackageManager;

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

Related Tutorials