Differences between MapView, MapFrament, and MapFragment Support

I would know the differences because I am developing an application and I would introduce the Google Map API v2 to compile above Android 2.3. What should i use?

+5
source share
1 answer

MapView:

A View, in which map displayed (with data obtained in the Google Maps service). When focused, it will capture key-presses and touch gestures to move the map.

Users of this class must redirect all lifecycle methods from Activity or Fragment containing this view to the corresponding classes of this class.

Use it if you are going to add map to Fragment . (you need to update each life cycle to MapView).

See the Google API Documentation

MapFragment:

A map in the application. This Fragment is the easiest way to place a map in an application. This is a wrapper around the map view to automatically process the necessary life cycles.

Use it if you want to add the map class to Activity (not a fragment because it will create a nested fragment, and this is a mess).

See the Google APIs Documentation .

SupportMapFragment:

A map in the application. This Fragment is the easiest way to place a map in the application. This is a wrapper around the map view to automatically process the necessary life cycles. Being a Fragment , this component can be added to the activity's layout file simply

Use SupportMapFragment if you configure Android API levels below 12.

See the Google APIs Documentation .

+4
source

All Articles