check Is Install Google Map - Android Map

Android examples for Map:Google Map

Description

check Is Install Google Map

Demo Code

import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageInfo;
import java.util.ArrayList;
import java.util.List;

public class Main{

    public static boolean checkIsInstallGoogleMap(Context context) {
        boolean isInstallGMap = false;
        List<PackageInfo> packs = context.getPackageManager()
                .getInstalledPackages(0);
        for (int i = 0; i < packs.size(); i++) {
            PackageInfo p = packs.get(i);
            if (p.versionName == null) { // system packages
                continue;
            }/* w  w  w .ja  va 2 s  . com*/
            if ("com.google.android.apps.maps".equals(p.packageName)) {
                isInstallGMap = true;
                break;
            }
        }
        return isInstallGMap;
    }

}

Related Tutorials