public final class SpeedingReporter
extends java.lang.Object
init()初始化和{cleanup()清除模块enable(boolean)开启/关闭模块;setCallback(Callback)设置回调setBeepThreshold(int)和getBeepThreshold()设置和获取超速提醒门限;setStrategy(int)和getStrategy()设置和获取播报策略;SpeedingReporter.Event.startSpeeding,从超速变成正常时,触发事件 SpeedingReporter.Event.endSpeeding
, 播报超速蜂鸣声时,触发事件 SpeedingReporter.Event.beep,客户端可根据需要做相应的显示NaviSession初始化完后调用| 限定符和类型 | 类和说明 |
|---|---|
static interface |
SpeedingReporter.Callback
超速事件回调
|
class |
SpeedingReporter.Event
超速事件
|
class |
SpeedingReporter.Strategy
播报策略
|
| 构造器和说明 |
|---|
SpeedingReporter() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
cleanup()
清除
|
static void |
enable(boolean enable)
开启模块,默认模块开启
|
static void |
enableInSimulation(boolean enable)
允许在模拟导航情况下模块功能是否有效,默认值:false
|
static int |
getBeepThreshold()
获取超速提醒门限
|
static int |
getCounter()
获取超速统计次数
|
static int |
getStrategy()
获取播报策略
|
static boolean |
init()
初始化
|
static boolean |
isEnable()
判断模块是否开启
|
static boolean |
isInited()
判断模块是否已经初始化
|
static void |
resetCounter()
超速次数重置为0
|
static void |
setBeepThreshold(int percentage)
设置超速提醒门限
|
static void |
setCallback(SpeedingReporter.Callback listener)
设置超速播报回调
|
static void |
setStrategy(int strategy)
设置播报策略,默认为
SpeedingReporter.Strategy.beep |
public static boolean init()
throws InitializationException
InitializationException)后调用, 注意:模块初始化过程必须在主线程中调用。 public static boolean isInited()
public static void cleanup()
public static void setCallback(SpeedingReporter.Callback listener)
listener - SpeedingReporter.Callbackpublic static void enable(boolean enable)
enable - 为true时开启模块,false时关闭public static boolean isEnable()
public static void setBeepThreshold(int percentage)
percentage - 单位:1%. 达到限速的percentage%时, 开始提醒. 默认值为100,表示达到限速时提醒getBeepThreshold()public static int getBeepThreshold()
setBeepThreshold(int)public static void setStrategy(int strategy)
SpeedingReporter.Strategy.beepstrategy - 播报策略SpeedingReporter.StrategygetStrategy()public static int getStrategy()
SpeedingReporter.Strategy,未初始化时返回默认策略setStrategy(int)public static int getCounter()
public static void resetCounter()
public static void enableInSimulation(boolean enable)
enable - 为true时开启模块模块,false时关闭©Mapbar Engine Team;All Rights Reserved