public class MyDevice
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private android.content.Context |
mAppContext
Global Application Context
|
private static MyDevice |
sInstance |
Modifier | Constructor and Description |
---|---|
private |
MyDevice(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDisplayName()
A String suitable for display
|
java.lang.String |
getModel() |
java.lang.String |
getNickname() |
java.lang.String |
getOS() |
java.lang.String |
getSN() |
java.lang.String |
getUniqueName()
A String that is unique for a Device
|
static MyDevice |
INST(android.content.Context context)
Lazily create our instance
|
void |
notifyRegistered()
Notify listeners that our Device was registered
|
void |
notifyRegisterError(java.lang.String message)
Notify listeners that registration failed
|
void |
notifyRemoved()
Notify listeners that our Device was removed
|
void |
notifyUnregistered()
Notify listeners that our Device was unregistered
|
private void |
sendBroadcast(java.lang.String action,
java.lang.String extra,
java.lang.String extraValue)
Broadcast changes to listeners
|
private static MyDevice sInstance
private final android.content.Context mAppContext
public static MyDevice INST(@NonNull android.content.Context context)
context
- any old contextpublic java.lang.String getModel()
public java.lang.String getSN()
public java.lang.String getOS()
public java.lang.String getNickname()
public java.lang.String getDisplayName()
public java.lang.String getUniqueName()
public void notifyRemoved()
public void notifyRegistered()
public void notifyUnregistered()
public void notifyRegisterError(java.lang.String message)
message
- error messageprivate void sendBroadcast(java.lang.String action, java.lang.String extra, java.lang.String extraValue)
action
- the type of the changeextra
- extra String info typeextraValue
- value of extra