public class BeaconService
extends android.app.Service
BeaconManager
.Modifier and Type | Class and Description |
---|---|
static class |
BeaconService.ScanAlarmBroadcastReceiver |
Modifier and Type | Field and Description |
---|---|
static int |
ERROR_BLUETOOTH_SCANNER_UNSTABLE
Happens when Bluetooth service is crashing frequently.
|
static int |
ERROR_COULD_NOT_START_LOW_ENERGY_SCANNING
Happens when Bluetooth service for some reason does not want to start low energy scanning.
|
static java.lang.String |
ERROR_ID_KEY
Key to data where
Integer (error id) is stored. |
static java.lang.String |
MONITORING_RESULT_KEY
Key to data where
MonitoringResult is stored. |
static int |
MSG_EDDYSTONE_SCAN_RESPONSE
Service sends Eddystone scanning result.
|
static int |
MSG_ERROR_RESPONSE
Service sends error.
|
static int |
MSG_LOCATIONS_SCAN_RESPONSE
Service sends Esitmote Location scanning result.
|
static int |
MSG_MONITORING_RESPONSE
Service sends monitoring results.
|
static int |
MSG_NEARABLE_SCAN_RESPONSE
Service sends Nearable scanning result.
|
static int |
MSG_RANGING_RESPONSE
Service sends ranging results.
|
static int |
MSG_REGISTER_ERROR_LISTENER
Service registers error listener where errors can be send.
|
static int |
MSG_REGISTER_SCAN_STATUS_LISTENER
Starts Bluetooth scanning.
|
static int |
MSG_SCAN_STARTED
Starts Bluetooth scanning.
|
static int |
MSG_SCAN_STOPPED
Starts Bluetooth scanning.
|
static int |
MSG_SET_BACKGROUND_SCAN_PERIOD
Sets scan periods for monitoring, that is when app is in foreground.
|
static int |
MSG_SET_FOREGROUND_SCAN_PERIOD
Sets scan periods for ranging, that is when app is in foreground.
|
static int |
MSG_SET_REGION_EXIT_EXPIRATION
Starts Bluetooth scanning.
|
static int |
MSG_START_EDDYSTONE_SCANNING
Starts Eddystone scanning.
|
static int |
MSG_START_LOCATION_SCANNING
Starts Esitmote Location scanning.
|
static int |
MSG_START_MONITORING
Service starts monitoring region.
|
static int |
MSG_START_NEARABLE_SCANNING
Starts Nearable scanning.
|
static int |
MSG_START_RANGING
Service starts ranging region.
|
static int |
MSG_START_TELEMETRY_SCANNING
Starts Telemetry scanning.
|
static int |
MSG_STOP_EDDYSTONE_SCANNING
Stops Eddystone scanning.
|
static int |
MSG_STOP_LOCATION_SCANNING
Stops Esitmote Location scanning.
|
static int |
MSG_STOP_MONITORING
Service stops monitoring region.
|
static int |
MSG_STOP_NEARABLE_SCANNING
Stops Nearable scanning.
|
static int |
MSG_STOP_RANGING
Service stops ranging region.
|
static int |
MSG_STOP_TELEMETRY_SCANNING
Stops Telemetry scanning.
|
static int |
MSG_TELEMETRY_SCAN_RESPONSE
Service sends Telemetry scanning result.
|
static java.lang.String |
RANGING_RESULT_KEY
Key to data where
RangingResult is stored. |
static java.lang.String |
REGION_EXIT_EXPIRATION
Key to data where
Integer (error id) is stored. |
static java.lang.String |
REGION_ID_KEY
Key to data where
String (region id) is stored. |
static java.lang.String |
REGION_KEY
Key to data where
Region is stored. |
static java.lang.String |
SCAN_PERIOD_KEY
Key to data where
ScanPeriodData is stored. |
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY, STOP_FOREGROUND_DETACH, STOP_FOREGROUND_REMOVE
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, FINGERPRINT_SERVICE, HARDWARE_PROPERTIES_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_STATS_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
Constructor and Description |
---|
BeaconService() |
Modifier and Type | Method and Description |
---|---|
android.os.IBinder |
onBind(android.content.Intent intent) |
void |
onCreate() |
void |
onDestroy() |
void |
onRebind(android.content.Intent intent) |
int |
onStartCommand(android.content.Intent intent,
int flags,
int startId) |
boolean |
onUnbind(android.content.Intent intent) |
dump, getApplication, onConfigurationChanged, onLowMemory, onStart, onTaskRemoved, onTrimMemory, startForeground, stopForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
attachBaseContext, bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterReceiver
public static final int MSG_START_RANGING
Region
under REGION_KEY
.public static final int MSG_STOP_RANGING
String
(region id) under REGION_ID_KEY
.public static final int MSG_RANGING_RESPONSE
RangingResult
under RANGING_RESULT_KEY
.public static final int MSG_START_MONITORING
Region
under REGION_KEY
.public static final int MSG_STOP_MONITORING
String
(region id) under REGION_ID_KEY
.public static final int MSG_START_EDDYSTONE_SCANNING
public static final int MSG_EDDYSTONE_SCAN_RESPONSE
public static final int MSG_STOP_EDDYSTONE_SCANNING
public static final int MSG_START_NEARABLE_SCANNING
public static final int MSG_NEARABLE_SCAN_RESPONSE
public static final int MSG_STOP_NEARABLE_SCANNING
public static final int MSG_START_TELEMETRY_SCANNING
public static final int MSG_TELEMETRY_SCAN_RESPONSE
public static final int MSG_STOP_TELEMETRY_SCANNING
public static final int MSG_START_LOCATION_SCANNING
public static final int MSG_LOCATIONS_SCAN_RESPONSE
public static final int MSG_STOP_LOCATION_SCANNING
public static final int MSG_MONITORING_RESPONSE
MonitoringResult
under MONITORING_RESULT_KEY
.public static final int MSG_REGISTER_ERROR_LISTENER
public static final int MSG_ERROR_RESPONSE
Integer
as error id under ERROR_ID_KEY
.public static final int MSG_SET_FOREGROUND_SCAN_PERIOD
ScanPeriodData
.public static final int MSG_SET_BACKGROUND_SCAN_PERIOD
ScanPeriodData
.public static final int MSG_SCAN_STARTED
public static final int MSG_SCAN_STOPPED
public static final int MSG_REGISTER_SCAN_STATUS_LISTENER
public static final int MSG_SET_REGION_EXIT_EXPIRATION
public static final int ERROR_COULD_NOT_START_LOW_ENERGY_SCANNING
public static final int ERROR_BLUETOOTH_SCANNER_UNSTABLE
public static final java.lang.String REGION_KEY
Region
is stored.public static final java.lang.String REGION_ID_KEY
String
(region id) is stored.public static final java.lang.String RANGING_RESULT_KEY
RangingResult
is stored.public static final java.lang.String MONITORING_RESULT_KEY
MonitoringResult
is stored.public static final java.lang.String SCAN_PERIOD_KEY
ScanPeriodData
is stored.public static final java.lang.String ERROR_ID_KEY
Integer
(error id) is stored.public static final java.lang.String REGION_EXIT_EXPIRATION
Integer
(error id) is stored.public void onCreate()
onCreate
in class android.app.Service
public int onStartCommand(android.content.Intent intent, int flags, int startId)
onStartCommand
in class android.app.Service
public void onDestroy()
onDestroy
in class android.app.Service
public android.os.IBinder onBind(android.content.Intent intent)
onBind
in class android.app.Service
public boolean onUnbind(android.content.Intent intent)
onUnbind
in class android.app.Service
public void onRebind(android.content.Intent intent)
onRebind
in class android.app.Service