title: Localisation Service doesn't start android
body: <p>I'm working on an android map and i'm trying to use Service class to find the current location of users. I had already succeed to do that whitout Service (directly in the main activity) but given the fact that i'll do network operations to find adresses and points of interest i thinked it was a good training to try Service with current location.</p>
  
  <p>But the problem is my service doesn't start at all even if i reported it in the manifest</p>
  
  <p>my class which extends Service :</p>
  
  <p>` </p>
  
  <pre><code> package toutel.testcarte;
  
   import org.osmdroid.bonuspack.overlays.Marker;
   import org.osmdroid.util.GeoPoint;
   import org.osmdroid.views.MapController;
   import org.osmdroid.views.MapView;
   import android.app.Service;
   import android.content.Context;
   import android.content.Intent;
   import android.location.Location;
   import android.location.LocationListener;
   import android.location.LocationManager;
   import android.os.Bundle;
   import android.os.IBinder;
  
    public class FindMe extends Service {
  
  private MapView mapView;
  private MapController mapController;
  private LocationManager lm;
  
  private LocationListener mylocationlistener = new LocationListener() {
  
      public void onLocationChanged(Location location) {
  
          // Context ctx = getApplicationContext();
          GeoPoint myposition = new GeoPoint(location.getLatitude(),
                  location.getLongitude());
          mapController.animateTo(myposition);
          mapController.setCenter(myposition);
          mapController.setZoom(17);
          Marker marker = new Marker(mapView);
          marker.setPosition(myposition);
          marker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
          mapView.getOverlays().add(marker);
          mapView.invalidate();
          try {
              Thread.sleep(5 * 1000);
          }
  
          catch (InterruptedException e) {
              e.printStackTrace();
          }
          mapView.getOverlays().clear();
  
      }
  
      public void onProviderDisabled(String provider) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void onProviderEnabled(String provider) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void onStatusChanged(String provider, int status, Bundle extras) {
          // TODO Auto-generated method stub
  
      }
  
  };
  
  public IBinder onBind(Intent arg0) {
  
      return null;
  }
  
  public void onCreate(Bundle savedInstanceState) {
  
      LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
      lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0,
              mylocationlistener);
      lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10000, 0,
              mylocationlistener);
      super.onCreate();
  }
  
  public int onStartCommand(Intent intent, int flags, int startId) {
  
      return super.onStartCommand(intent, flags, startId);
  }
  
  public void onDestroy() {
  
      super.onDestroy();
      lm.removeUpdates(mylocationlistener);
  }
  </code></pre>
  
  <p>}
  `</p>
  
  <p>Im starting the service in the main activity with </p>
  
  <p><code>startService(new Intent(MainActivity.this, FindMe.class));</code></p>
  
  <p>and i added the service in the manifest :</p>
  
  <pre><code>&lt;service android:name = "toutel.testcarte.FindMe"&gt; &lt;/service&gt;
  </code></pre>
  
  <p>So what am i doing wrong ?</p>
  
  <p>Thanks !</p>