Personally, I have been struggling with both MapFragment (MF) and SupportMapFragment (SMF), but i didn't get what i wanted from places like You tube, Lynda ,stack overflow, GitHub, blog posts from Chinese and India Android bloggers so i decided to make life easy for other people trying to work with Google Maps in Android.
A Map component in an app. This fragment is the simplest way to place a map in an
application. Its a wrapper around a view of a map to automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity's layout file simply with the XML below.
From developer.google
XML Code:
<fragment
android:id="@+id/map"
class="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
The above code makes the Google map show on your layout, that's after you have inserted the google Api inside the manifest.
Support Map Fragment:
A Map component in an app. This fragment is the simplest way to place a map in an
A Map component in an app. This fragment is the simplest way to place a map in an
application. Its a wrapper around a view of a map automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity's layout file simply with XML below.
From developer.google.
<fragment
android:id="@+id/map"
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
By knowing the outlined differences working with MF and SMF will be easier....
MapFragment: It requires the native API Level 11 Fragment implementation, and therefore can only be used on API level 11 and higher devices. So far i haven't seen any device running in API level 11 everything has been upgraded to API Level 12.
SupportMapFragment: It can be used on Android devices running API 10 and lower, as well as Android devices running 11 and higher. Basically on both unlike MapFragment.
Basically, SupportMapFragment supports more Android versions, but you have some additional library to add into your project, for me it depends on the Android versions you are targeting, MF and SMF also have two different java syntax
For SMF
SupportMapFragment sMapF = (SupportMapFragment) getSupportFragmentManager()findFragmentById(R.id.map);
Finally v4 Support library needs to be installed if working on older versions, it just works automatically for recent versions (Default Components will do).
if you want to read more, Click the links below
http://developer.android.com/tools/support-library/features.html
http://developer.android.com/tools/support-library/index.html
https://developers.google.com/maps/
MapFragment: It requires the native API Level 11 Fragment implementation, and therefore can only be used on API level 11 and higher devices. So far i haven't seen any device running in API level 11 everything has been upgraded to API Level 12.
SupportMapFragment: It can be used on Android devices running API 10 and lower, as well as Android devices running 11 and higher. Basically on both unlike MapFragment.
Basically, SupportMapFragment supports more Android versions, but you have some additional library to add into your project, for me it depends on the Android versions you are targeting, MF and SMF also have two different java syntax
For SMF
SupportMapFragment sMapF = (SupportMapFragment) getSupportFragmentManager()findFragmentById(R.id.map);
sMapF.getMapAsync(this);
For MF
FragmentManager fragmentManager = getFragmentManager();
MapFragment mapFragment =
(MapFragment) fragmentManager.findFragmentById(R.id.Gmap);
googleMap = mapFragment.getMap();
if you want to read more, Click the links below
http://developer.android.com/tools/support-library/features.html
http://developer.android.com/tools/support-library/index.html
https://developers.google.com/maps/