public class SensoroManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SDK_VERSION |
Modifier and Type | Method and Description |
---|---|
boolean |
acquireWakeLock()
Acquires the wake lock.
Prevent the device going to sleep mode so that your application can discover iBeacon when the screen is turned off.
You need call
releaseWakeLock() when you are done and don't need the lock anymore. |
boolean |
addBroadcastKey(java.lang.String broadcastKey)
Add a broadcast key to decrypt a Yunzi with encryption.
|
long |
getCloudUploadPeriod()
Get the period the beacons is uploaded.
|
static SensoroManager |
getInstance(Context context)
Get the instance of SensoroManager
|
boolean |
isBluetoothEnabled()
Check whether the bluetooth is enabled.
|
boolean |
isCloudServiceGPSEnable()
Return the status whether gps of the beacons information is uploaded if the cloud service is enabled.
|
boolean |
releaseWakeLock()
Release the wake lock.
|
void |
setBackgroundBetweenScanPeriod(long periodMills)
Set the period (in milliseconds) between two scan periods in background
|
void |
setBackgroundScanPeriod(long periodMills)
set iBeaon scan period (in milliseconds) in background
|
void |
setBeaconManagerListener(BeaconManagerListener beaconManagerListener)
Set a BeaconManager listener
|
void |
setCloudServiceEnable(boolean enable)
Set cloud service enabled.
|
void |
setCloudServiceGPSEnable(boolean cloudServiceGPSEnable)
Set the status whether gps of the beacons information is uploaded.
|
void |
setCloudUploadPeriod(long cloudUploadPeriod)
If cloud service is enable, set the period the beacons is uploaded.If not setted, it will be 30 seconds.
|
void |
setForegroundBetweenScanPeriod(long periodMills)
Set the period (in milliseconds) between two scan periods in foreground
|
void |
setForegroundScanPeriod(long periodMills)
Set iBeacon scan period (in milliseconds) in foreground
|
void |
startService()
Start sensoro SDK service.
|
void |
stopService()
Stop sensoro SDK service.
|
public static final java.lang.String SDK_VERSION
public boolean isCloudServiceGPSEnable()
public void setCloudServiceGPSEnable(boolean cloudServiceGPSEnable)
cloudServiceGPSEnable
- the status.public static SensoroManager getInstance(Context context)
context
- The android context.public boolean acquireWakeLock()
releaseWakeLock()
when you are done and don't need the lock anymore.public boolean releaseWakeLock()
public void setForegroundScanPeriod(long periodMills)
periodMills
- Default value is 1.1 s(unit:ms)public void setForegroundBetweenScanPeriod(long periodMills)
periodMills
- Default value is 0 s(unit:ms)public void setBackgroundScanPeriod(long periodMills)
periodMills
- Default value is 10 s(unit:ms)public void setBackgroundBetweenScanPeriod(long periodMills)
periodMills
- Default value is 5 min(unit:ms)public boolean isBluetoothEnabled()
public boolean addBroadcastKey(java.lang.String broadcastKey)
broadcastKey
- public void startService() throws java.lang.Exception
java.lang.Exception
public void stopService()
public void setBeaconManagerListener(BeaconManagerListener beaconManagerListener)
beaconManagerListener
- The listener to set.public void setCloudServiceEnable(boolean enable)
enable
- public long getCloudUploadPeriod()
public void setCloudUploadPeriod(long cloudUploadPeriod)
cloudUploadPeriod
- the period in ms.