سؤال

I read through various blogs stating the Google Maps in Android supports from API Version 13. My app requires google maps to be displayed. I want to make a configuration such that if the Android SDK version of the phone is 13 and above, it should display the maps. If it is lesser, then the maps should not be displayed.

I cannot find any good answers for this problem. Pls help.

هل كانت مفيدة؟

المحلول

Here's how you can check for version number:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
    // Your code to show maps
}
else {
    // Do something else
}

نصائح أخرى

The Google Maps Android API supports SDK8+ (Froyo) with SupportMapFragment.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top