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

后端 未结 8 1130
别那么骄傲
别那么骄傲 2020-12-02 16:21

I am currently developing an android application uses Google map API.

I am wondering do all android devices support map API, becuase this api is an optinal api and i

8条回答
  •  长情又很酷
    2020-12-02 16:55

    You are right, some Devices, like Archos 5IT and Some Tablet does not have Google Maps, Android Market, etc...

    Here is my Code. BelgianMap is a MapActivity:

    try {
        Intent i = new Intent(InfoGare.this, BelgianMap.class);
        startActivityForResult(i, 0);
    }
    catch(ActivityNotFoundException e) {
        Toast.makeText(context, "Google Map not found", Toast.LENGTH_LONG).show();
    }
    

    But maybe there is an other way to find that at the creation of your application and display a message. That might be better.

提交回复
热议问题