-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.ComponentCallbacks2
public class BeaconService extends Service
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBeaconService.BeaconBinderClass used for the client Binder. Because we know this service always runs in the same process as its clients, we don't need to deal with IPC.
-
Field Summary
Fields Modifier and Type Field Description public final static StringTAGpublic final static intMSG_START_RANGINGpublic final static intMSG_STOP_RANGINGpublic final static intMSG_START_MONITORINGpublic final static intMSG_STOP_MONITORINGpublic final static intMSG_SET_SCAN_PERIODSpublic final static intMSG_SYNC_SETTINGS
-
Method Summary
Modifier and Type Method Description voidonCreate()intonStartCommand(Intent intent, int flags, int startId)IBinderonBind(Intent intent)When binding to the service, we return an interface to our messenger for sending messages to the service. booleanonUnbind(Intent intent)voidonDestroy()voidonTaskRemoved(Intent rootIntent)voidstartRangingBeaconsInRegion(Region region, Callback callback)methods for clients voidstopRangingBeaconsInRegion(Region region)voidstartMonitoringBeaconsInRegion(Region region, Callback callback)voidstopMonitoringBeaconsInRegion(Region region)voidsetScanPeriods(long scanPeriod, long betweenScanPeriod, boolean backgroundFlag)voidreloadParsers()-
Methods inherited from class android.app.Service
getApplication, getForegroundServiceType, onConfigurationChanged, onLowMemory, onRebind, onStart, onTrimMemory, startForeground, stopForeground, stopSelf, stopSelfResult -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, clearWallpaper, createAttributionContext, createConfigurationContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, startActivities, startActivity, startForegroundService, startInstrumentation, startIntentSender, startService, stopService, unbindService, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, registerComponentCallbacks, sendBroadcastWithMultiplePermissions, unregisterComponentCallbacks -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCreate
@MainThread() void onCreate()
-
onStartCommand
int onStartCommand(Intent intent, int flags, int startId)
-
onBind
IBinder onBind(Intent intent)
When binding to the service, we return an interface to our messenger for sending messages to the service.
-
onDestroy
@MainThread() void onDestroy()
-
onTaskRemoved
void onTaskRemoved(Intent rootIntent)
-
startRangingBeaconsInRegion
@MainThread() void startRangingBeaconsInRegion(Region region, Callback callback)
methods for clients
-
stopRangingBeaconsInRegion
@MainThread() void stopRangingBeaconsInRegion(Region region)
-
startMonitoringBeaconsInRegion
@MainThread() void startMonitoringBeaconsInRegion(Region region, Callback callback)
-
stopMonitoringBeaconsInRegion
@MainThread() void stopMonitoringBeaconsInRegion(Region region)
-
setScanPeriods
@MainThread() void setScanPeriods(long scanPeriod, long betweenScanPeriod, boolean backgroundFlag)
-
reloadParsers
void reloadParsers()
-
-
-
-