-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.ComponentCallbacks2,android.location.LocationListener
public class GPSTracker extends Service implements LocationListener
-
-
Constructor Summary
Constructors Constructor Description GPSTracker(Context context)
-
Method Summary
Modifier and Type Method Description LocationgetLocation()doublegetLatitude()Function to get latitude doublegetLongitude()Function to get longitude voidstopUsingGPS()Stop using GPS listenerCalling this function will stop using GPS in your app booleancanGetLocation()Function to check GPS/wifi enabled voidshowSettingsAlert()Function to show settings alert dialogOn pressing Settings button will lauch Settings Options voidonLocationChanged(Location location)voidonProviderDisabled(String provider)voidonProviderEnabled(String provider)voidonStatusChanged(String provider, int status, Bundle extras)IBinderonBind(Intent arg0)-
Methods inherited from class android.app.Service
getApplication, getForegroundServiceType, onBind, onConfigurationChanged, onCreate, onDestroy, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTimeout, onTrimMemory, onUnbind, startForeground, stopForeground, stopSelf, stopSelfResult -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkContentUriPermissionFull, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDeviceId, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerComponentCallbacks, registerDeviceIdChangeListener, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, startActivities, startActivity, startForegroundService, startInstrumentation, startIntentSender, startService, stopService, unbindService, unregisterComponentCallbacks, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions -
Methods inherited from class android.location.LocationListener
onFlushComplete, onLocationChanged, onProviderDisabled, onProviderEnabled, onStatusChanged -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
GPSTracker
GPSTracker(Context context)
-
-
Method Detail
-
getLocation
Location getLocation()
-
getLatitude
double getLatitude()
Function to get latitude
-
getLongitude
double getLongitude()
Function to get longitude
-
stopUsingGPS
void stopUsingGPS()
Stop using GPS listenerCalling this function will stop using GPS in your app
-
canGetLocation
boolean canGetLocation()
Function to check GPS/wifi enabled
-
showSettingsAlert
void showSettingsAlert()
Function to show settings alert dialogOn pressing Settings button will lauch Settings Options
-
onLocationChanged
void onLocationChanged(Location location)
-
onProviderDisabled
void onProviderDisabled(String provider)
-
onProviderEnabled
void onProviderEnabled(String provider)
-
onStatusChanged
void onStatusChanged(String provider, int status, Bundle extras)
-
-
-
-