com.samsung.android.sdk.penremote

Class 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().

    • 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 be FEATURE_TYPE_BUTTON or FEATURE_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 application
        listener - 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