How to detect an android device whether it supports google maps API

I have used following solution in addition to described

<uses-library android:name="com.google.android.maps" android:required="false"/>

in another answers:

public void mapClick(View view)
{
    try
    {
        // check if Google Maps is supported on given device
        Class.forName("com.google.android.maps.MapActivity");

        this.startActivity(new Intent(this, MyMapActivity.class));
    }
    catch (Exception e)
    {
        e.printStackTrace();
        UIUtils.showAlert(this, R.string.google_maps_not_found);
    }
}

Leave a Comment