com.samsung.android.sdk.penremote
Class SpenRemote
- java.lang.Object
-
- com.samsung.android.sdk.penremote.SpenRemote
-
public class SpenRemote extends Object
SpenRemote is the entry class that provides access to the S Pen Remote SDK. This class provides methods for initializing the S Pen Remote SDK and for checking whether the S Pen Remote feature is supported. All Samsung SDKs, including the S Pen Remote SDK, provide a uniform interface for initialization, checking whether features are enabled, and getting the SDK version info. The application must call initialize(Context) to initialize the S Pen Remote SDK before using it. To get the version number (int) and name (string) of the S Pen Remote SDK, call getVersionCode() and getVersionName().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
SpenRemote.ConnectionResultCallback
Interface for listening connection result.static interface
SpenRemote.ConnectionStateChangeListener
Interface for listening connection state.static class
SpenRemote.Error
Error Codestatic class
SpenRemote.State
State Code
-
Field Summary
Fields Modifier and Type Field and Description static int
FEATURE_TYPE_AIR_MOTION
A constant describing an air motion.static int
FEATURE_TYPE_BUTTON
A constant describing a Button.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
connect(android.content.Context context, SpenRemote.ConnectionResultCallback listener)
Establish Connection to the S Pen framework.void
disconnect(android.content.Context context)
Disconnects an established connection.static SpenRemote
getInstance()
Get instance of SpenRemoteint
getVersionCode()
Returns the version number of the S Pen Remote SDK.String
getVersionName()
Returns the version name of the S Pen Remote SDK.boolean
isConnected()
Check if connection is established.boolean
isFeatureEnabled(int type)
Returns true if the S Pen Remote feature on the device is enabled.void
setConnectionStateChangeListener(SpenRemote.ConnectionStateChangeListener listener)
Set the callback that pass connection state when the state is changed.
-
-
-
Field Detail
-
FEATURE_TYPE_BUTTON
public static final int FEATURE_TYPE_BUTTON
A constant describing a Button.- See Also:
- Constant Field Values
-
FEATURE_TYPE_AIR_MOTION
public static final int FEATURE_TYPE_AIR_MOTION
A constant describing an air motion.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static SpenRemote getInstance()
Get instance of SpenRemote
-
isFeatureEnabled
public boolean isFeatureEnabled(int type)
Returns true if the S Pen Remote feature on the device is enabled.- Parameters:
type
- The feature ID, must beFEATURE_TYPE_BUTTON
orFEATURE_TYPE_AIR_MOTION
- Returns:
- true if the S Pen Remote feature is available on the device, else false
- Since:
- 1.0.0
-
getVersionCode
public int getVersionCode()
Returns the version number of the S Pen Remote SDK.- Returns:
- The S Pen Remote SDK version number
- Since:
- 1.0.0
-
getVersionName
public String getVersionName()
Returns the version name of the S Pen Remote SDK.- Returns:
- The S Pen Remote SDK version name
- Since:
- 1.0.0
-
connect
public void connect(android.content.Context context, SpenRemote.ConnectionResultCallback listener)
Establish Connection to the S Pen framework. The connection result is returned to ConnectionListener.- Parameters:
context
- The Context for your applicationlistener
- The listener to receive the connection result- Since:
- 1.0.0
-
setConnectionStateChangeListener
public void setConnectionStateChangeListener(SpenRemote.ConnectionStateChangeListener listener)
Set the callback that pass connection state when the state is changed.- Parameters:
listener
- The listener to receive the connection state- Since:
- 1.0.0
-
disconnect
public void disconnect(android.content.Context context)
Disconnects an established connection.- Since:
- 1.0.0
-
isConnected
public boolean isConnected()
Check if connection is established.- Since:
- 1.0.0
-
-