Which is the default provider for LocationSource?
<p><code>LocationSource</code> is just an Interface to help me with location-data.
It makes use of the <a href="http://developer.android.com/reference/com/google/android/gms/maps/LocationSource.OnLocationChangedListener.html#onLocationChanged%28android.location.Location%29" rel="nofollow">onLocationChanged(Location location)</a> method which takes a Location object as parameter ( lat, long and other info ).</p>

<p>So if I understand well what is says here : </p>

<pre><code>A GoogleMap object has a built-in location provider for its my-location layer, but it can be replaced with another one that implements this interface.
</code></pre>

<p>...there is a <strong>new</strong> ( a built-in location provider ) location provider for my GoogleMap object, although I can make use of the <code>LocationManager</code> and choose from there </p>

<p>My code is below ( as you can see I don't make any use of the LocationManager ) and I get a very accurate location when I click for my location ( <code>mMap.setMyLocationEnabled(true);</code>  ) 
If I have the GPS on I can get my location so do I when I have only the wifi.</p>

<p>So my question is : this new provider is something "different" from GPS/network ? If I don't use locationManager there will be a problem? ( yes I know for an official app I better make use of the LocationManager to check every case but it still works  ).</p>

<p>My guess is it uses either  GPS or network but if I have both enabled which one is the default? Which provider the app makes use first ?</p>

<p><strong>Code</strong> : </p>

<pre><code>public class MainActivity extends FragmentActivity implements OnMapClickListener, OnMapLongClickListener, LocationSource, LocationListener {

private GoogleMap mMap;
private OnLocationChangedListener mapLocationListener=null;

private static final LatLng SKG_VIEW = new LatLng(40.6402778, 22.9438889);

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    setUpMapIfNeeded();               

//   mMap = ( (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)  ).getMap();

}

@Override
protected void onResume() {
    super.onResume();
    setUpMapIfNeeded();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}


/**  **************** SetUp Map if needed *****************
 * 
 * Sets up the map if it is possible to do so (i.e., the Google Play services APK is correctly
 * installed) and the map has not already been instantiated.. This will ensure that we only ever
 * call {@link #setUpMap()} once when {@link #mMap} is not null.
 * &lt;p&gt;
 * If it isn't installed {@link SupportMapFragment} (and
 * {@link com.google.android.gms.maps.MapView
 * MapView}) will show a prompt for the user to install/update the Google Play services APK on
 * their device.
 * &lt;p&gt;
 * A user can return to this Activity after following the prompt and correctly
 * installing/updating/enabling the Google Play services. Since the Activity may not have been
 * completely destroyed during this process (it is likely that it would only be stopped or
 * paused), {@link #onCreate(Bundle)} may not be called again so we should call this method in
 * {@link #onResume()} to guarantee that it will be called.
 */
private void setUpMapIfNeeded() {
    // Do a null check to confirm that we have not already instantiated the map.
    if (mMap == null) {
        // Try to obtain the map from the SupportMapFragment.
        mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                .getMap();
        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        mMap.setMyLocationEnabled(true);
        mMap.setOnMapClickListener(this);


             /***
              *         *****   CAMERA ***** 
              ***/


     // Construct a CameraPosition focusing on Mountain View and animate the camera to that position.
        CameraPosition cameraPosition = new CameraPosition.Builder()
            .target(SKG_VIEW)      // Sets the center of the map to SKG_VIEW point
            .zoom(7)                   // Sets the zoom
            .build();                   // Creates a CameraPosition from the builder

        mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

        // Check if we were successful in obtaining the map.
        if (mMap != null) {
            setUpMap();
        }
    }
}
/** ******************   Add Markers ***************************
 * 
 * This is where we can add markers or lines, add listeners or move the camera. In this case, we
 * just add a marker near Africa.
 * 
 * This should only be called once and when we are sure that {@link #mMap} is not null.
 */
private void setUpMap() {
    mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
    mMap.addMarker(new MarkerOptions().position(new LatLng(10, 10)).title("Marker 2"));
    mMap.addMarker(new MarkerOptions().position(new LatLng(40, 40)).title("Marker 2"));

}

/**
 * 
 * *****************  onMapClick *******************************
 * 
 */

@Override
public void onMapClick(LatLng point) {
        mMap.animateCamera(CameraUpdateFactory.newLatLng(point));

}

@Override
public void onMapLongClick(LatLng point) {
    //dont need it right now        
}

@Override
public void activate(OnLocationChangedListener listener) {
    // LocationSource
    this.mapLocationListener=listener;
}

@Override
public void deactivate() {
    // LocationSource
    this.mapLocationListener=null;
}


public void OnLocationChanged(Location location)    {                               //LocationListener
        if( mapLocationListener != null )   {
            mapLocationListener.onLocationChanged(location);

            double lat = location.getLatitude();
            double lon = location.getLongitude();

            Log.v("TAG", "i was here");
        }
}


@Override   
public void onProviderDisabled(String provider) {                                   //LocationListener
    // TODO Auto-generated method stub

}

@Override
public void onProviderEnabled(String provider) {                                    //LocationListener
    // TODO Auto-generated method stub

}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    // TODO Auto-generated method stub

}


}
</code></pre>
