is Google Maps V Available - Android Phone

Android examples for Phone:Phone Information

Description

is Google Maps V Available

Demo Code


//package com.java2s;

import android.content.Context;

import android.widget.Toast;

public class Main {
    public static boolean isGoogleMapsV1Available(Context c,
            boolean showToastOnException) {
        try {/*from w ww  .  ja va2  s. c o m*/
            Class.forName("com.google.android.maps.MapActivity");
        } catch (ClassNotFoundException e) {
            if (showToastOnException) {
                Toast.makeText(
                        c,
                        "Unable to initialize maps on your device. If this is a custom ROM, you may be missing the Google maps library.",
                        Toast.LENGTH_LONG).show();
            }

            return false;
        }

        return true;
    }
}

Related Tutorials