Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GPSTracker extends Service implements LocationListener {
- private final Context mContext;
- // flag for GPS status
- boolean isGPSEnabled = false;
- // flag for network status
- boolean isNetworkEnabled = false;
- boolean canGetLocation = false;
- Location location; // location
- double latitude; // latitude
- double longitude; // longitude
- // The minimum distance to change Updates in meters
- private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
- // The minimum time between updates in milliseconds
- private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
- // Declaring a Location Manager
- protected LocationManager locationManager;
- public GPSTracker(Context context) {
- this.mContext = context;
- getLocation();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement