Back to project page SmartMap.
The source code is released under:
Apache License
If you think the Android project SmartMap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dennytech.smartmap; //from ww w. j a va2s. co m import android.content.Context; import android.content.pm.PackageManager; public class MapUtils { /** * Test if exist 'Google Map API' or not * * @param context * @return */ public static boolean hasGoogleMapApi(Context context) { PackageManager packageManager = context.getPackageManager(); boolean hasGoogleMapApi = false; String[] sharedLibraryNames = packageManager .getSystemSharedLibraryNames(); if (sharedLibraryNames != null) { for (String sharedLibraryName : sharedLibraryNames) { if ("com.google.android.maps".equals(sharedLibraryName)) { try { @SuppressWarnings("rawtypes") Class cl = Class .forName("com.google.android.maps.MapActivity"); if (cl != null) { hasGoogleMapApi = true; } } catch (Throwable e) { hasGoogleMapApi = false; } break; } } } return hasGoogleMapApi; } }