James Davis
James Davis

Reputation: 301

Why use MapFragment instead of SupportMapFragment?

I've done a bit of searching, but never found a good answer to this question.

If I have access to SupportMapFragment, why would I ever use MapFragment?

I know that MapFrag is supported only api level 11 and higher. However, what is the point of it if there's a version of it that supports a wider range of devices? In the same vein, does SupportMapFrag have any notable limitations? Is it less efficient or something?

I would happily just use MapFragment, but according to the Android Dashboards page, 33% of devices are running Gingerbread (api 10)... which is still a substantial amount of people that I don't want to alienate.

Thanks in advance.

--

Side note: Long time stackoverflow reader, but this is my first post. I know how much you guys hate questions that could have been answered by some light googling. I genuinely tried looking! lol, but I would still appreciate links to sites that answer this question sufficiently.

Upvotes: 1

Views: 3864

Answers (1)

Yoann Hercouet
Yoann Hercouet

Reputation: 17986

SupportMapFragment belongs to the v4 support library, contrary to the default MagFragment that is a native component in Android.

SupportMapFragment will support more Android versions, but it is also an additional library you have to add in your project, so I think it really depends on the Android versions you are targeting:

  • On recent versions, the default components should be enough
  • On older versions you will need to install the v4 support library and maybe others

Here are 2 links from the Android documentation giving details about the support libraries:

Support Library Features

http://developer.android.com/tools/support-library/features.html

Support Library Revisions

http://developer.android.com/tools/support-library/index.html

Upvotes: 1

Related Questions