Implicit super constructor Provider.Service() is undefined. Must explicitly invoke another constructor
public class GPSTracker extends Service implements LocationListener{ final Context context; boolean isGPSEnable=false; boolean isNetworkEnable=false; boolean canGetLocation=false; Location location; double latiude; double longitude; private static final long min_time_between_updates=1000*60*1; private static final long min_diatance_cahnge_for_updates=10; protected LocationManager locationManager; public GPSTracker(Context context) { this.context=context; getlocation(); } public Location getlocation(){ try{ locationManager=(LocationManager)context.getSystemService(Context.LOCATION_SERVICE); isGPSEnable=locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); isNetworkEnable=locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); if (isGPSEnable&&!isNetworkEnable) { } else{ this.canGetLocation=true; if(isNetworkEnable){ locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,min_time_between_updates, min_diatance_cahnge_for_updates, this); if(locationManager!=null){ location=locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if(location!=null){ latiude=location.getLatitude(); longitude=location.getLongitude(); }//third inner }//inner second }//main if if(isGPSEnable){ locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,min_time_between_updates, min_diatance_cahnge_for_updates, this); if(locationManager!=null){ location=locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if(location!=null){ latiude=location.getLatitude(); longitude=location.getLongitude(); }//third inner }//inner second }//main if } }catch(Exception e){ e.printStackTrace(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)