public class NeckbandManager extends java.lang.Object implements ConnectStateManage.Listener, AuthModel.Listener, NotifyModel.Listener, SupportCheckModel.Listener
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
FORMAT_ENABLED |
private java.lang.String |
mAccessToken |
private AuthModel |
mAuthModel |
private ConnectStateManage |
mConnectStateManage |
private FormatModel |
mFormatModel |
private InfoManage |
mInfoManage |
private static NeckbandManager |
mInstance |
private boolean |
mIsPreviewing |
private boolean |
mIsRecording |
private int |
mLatestBitrate |
private int |
mLatestFPS |
private int[] |
mLatestResolution |
private NotifyManage |
mNotifyManage |
private PhotoModel |
mPhotoModel |
private PreviewModel |
mPreviewModel |
private RecordModel |
mRecordModel |
private java.lang.String |
mSelectedLanguage |
private SetManage |
mSetManage |
private SupportCheckModel |
mSupportCheckModel |
private boolean[] |
mSupported |
Constructor and Description |
---|
NeckbandManager() |
Modifier and Type | Method and Description |
---|---|
void |
changedBTDevice(android.bluetooth.BluetoothDevice beforeDevice,
android.bluetooth.BluetoothDevice currentDevice) |
void |
completedGetAuth(boolean success,
java.lang.String accessToken)
after get access token from neckband's rest api server, initialize and check all functions and values.
|
void |
completedGetSupport(boolean success,
SupportCheckModel.Type type,
boolean isSupport) |
void |
completedSetClientIp(boolean success) |
void |
connect(java.lang.String id,
java.lang.String password)
after connected wifi p2p, you have to get access token from neckband's rest api.
|
void |
format(java.lang.String accessToken,
boolean isInternal,
FormatModel.Listener listener)
neckband's storage format
|
java.lang.String |
getAccessToken()
almost rest api need the access token.
|
ConnectStateManage |
getConnectStateManage()
ConnectStateManage module call back and store connect state
|
InfoManage |
getInfoManage()
InfoManage module can get neckband's spec and current state.
|
static NeckbandManager |
getInstance()
this is single tone pattern so you do not need make object as new.
|
NotifyManage |
getNotifyManage()
NotifyManage module send alert or record (start/stop) message with realtime.
|
PhotoModel |
getPhotoModel(PhotoModel.Listener listener) |
PreviewModel |
getPreviewModel() |
RecordModel |
getRecordModel() |
RecordModel |
getRecordModel(RecordModel.Listener listener) |
SetManage |
getSetManage()
SetManage module can get and set data about record, photo, a2dp etc.
|
NeckbandManager |
init(android.content.Context context)
you must call this function at least one time
because all modules initialized by this function.
|
private void |
initLatestRecordAndPreviewSet(android.content.Context context) |
boolean |
isPreviewing() |
boolean |
isRecording() |
boolean |
isSupport(SupportCheckModel.Type type)
if neckband firmware is old, several functions cannot use
|
void |
setConnectBTDevice(android.bluetooth.BluetoothDevice device) |
void |
setPreviewState(boolean isPreviewing) |
void |
setRecordState(boolean isRecording) |
private static final java.lang.String FORMAT_ENABLED
private static NeckbandManager mInstance
private ConnectStateManage mConnectStateManage
private SetManage mSetManage
private InfoManage mInfoManage
private NotifyManage mNotifyManage
private SupportCheckModel mSupportCheckModel
private AuthModel mAuthModel
private FormatModel mFormatModel
private RecordModel mRecordModel
private PhotoModel mPhotoModel
private PreviewModel mPreviewModel
private java.lang.String mAccessToken
private boolean mIsRecording
private boolean mIsPreviewing
private int[] mLatestResolution
private int mLatestBitrate
private int mLatestFPS
private java.lang.String mSelectedLanguage
private boolean[] mSupported
public static NeckbandManager getInstance()
public NeckbandManager init(android.content.Context context)
context
- you can use activity or application contextpublic java.lang.String getAccessToken()
public void connect(java.lang.String id, java.lang.String password)
id
- password
- private void initLatestRecordAndPreviewSet(android.content.Context context)
public SetManage getSetManage()
public InfoManage getInfoManage()
public ConnectStateManage getConnectStateManage()
public NotifyManage getNotifyManage()
public PreviewModel getPreviewModel()
public RecordModel getRecordModel(RecordModel.Listener listener)
public RecordModel getRecordModel()
public PhotoModel getPhotoModel(PhotoModel.Listener listener)
public void format(java.lang.String accessToken, boolean isInternal, FormatModel.Listener listener)
accessToken
- must needisInternal
- true : format internal storage, false : format external storagelistener
- call backpublic void setPreviewState(boolean isPreviewing)
public boolean isPreviewing()
public void setRecordState(boolean isRecording)
public boolean isRecording()
public boolean isSupport(SupportCheckModel.Type type)
type
- REVERSE, A2DP, HYPER_LAPSEpublic void setConnectBTDevice(android.bluetooth.BluetoothDevice device)
public void changedBTDevice(android.bluetooth.BluetoothDevice beforeDevice, android.bluetooth.BluetoothDevice currentDevice)
changedBTDevice
in interface ConnectStateManage.Listener
public void completedGetAuth(boolean success, java.lang.String accessToken)
completedGetAuth
in interface AuthModel.Listener
success
- accessToken
- public void completedSetClientIp(boolean success)
completedSetClientIp
in interface NotifyModel.Listener
public void completedGetSupport(boolean success, SupportCheckModel.Type type, boolean isSupport)
completedGetSupport
in interface SupportCheckModel.Listener