DeveloperDeveloper
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Native SDKs

    • Introduction
    • Lovense iOS SDK for iPhone app development
    • Lovense Android SDK for Android app development
    • Lovense Windows SDK for Windows app development
Got Stuck?
Forum for Lovense Developers
Click to explore the release pose for Android SDK
Support
Document Feedback

Android SDK

The Lovense Android SDK is a set of application interfaces based on Android 4.3 and above. Use this SDK to develop applications for Android mobile devices. By calling the Lovense SDK interface, you can easily control Lovense toys and build applications with rich functions and strong interactivity.

Download Demo

Step 1: Get the developer token

Go to the developer dashboard and get your developer token.

Step 2: Download and extract the Lovense SDK

Download SDK [Version: 1.5.2, Updated on: May 6, 2025]

Step 3: Include SDK and Configure

  1. Copy the following file to your libs directory.

    Lovense Android SDK Path

  2. Add lovense.arr to your app build.gradle. Configure libs in the program build.gradle.

    app build.gradle:

    implementation files ('libs/lovense.aar')

    program build.gradle:

    Lovense Android SDK build config

    add other implementations to app build.gradle:

     dependencies {
         implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    
         // toy sdk need implementation all kits of below
         implementation 'org.greenrobot:eventbus:3.3.1'
         implementation 'com.google.code.gson:gson:2.8.6'
         implementation 'com.tencent:mmkv:1.3.7'
         implementation 'androidx.room:room-runtime:2.5.0-alpha01'
         implementation 'net.zetetic:android-database-sqlcipher:4.5.3'
         implementation 'com.github.getActivity:XXPermissions:18.3'
    
         implementation 'com.squareup.retrofit2:retrofit:2.9.0'
         implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
         implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
         implementation 'me.jessyan:retrofit-url-manager:1.4.0'
         implementation 'io.reactivex.rxjava2:rxjava:2.2.20'
         implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    
         implementation 'androidx.core:core-ktx:1.13.1'
     }
    

    add proguard in your proguard-rules.pro

    Lovense-SDK

    # Lovense-SDK
    -keep class com.lovense.sdklibrary.** { *; }
    -keep class com.component.** { *; }
    

    Third-party libraries

    #eventBus
    -keep class org.greenrobot.eventbus.** { *; }
    -keepattributes *Annotation*
    -keepclassmembers class ** {
        @org.greenrobot.eventbus.Subscribe <methods>;
    }
    -keep enum org.greenrobot.eventbus.ThreadMode { *; }
    # Only required if you use AsyncExecutor
    -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
        <init>(Java.lang.Throwable);
    }
    
    # Gson
    -keep class com.google.gson.** { *; }
    -keepattributes *Annotation*
    -keepclassmembers class * {
        @com.google.gson.annotations.SerializedName <fields>;
    }
    
    # MMKV
    -keep class com.tencent.mmkv.** { *; }
    
    # Room Database
    -keep class androidx.room.** { *; }
    -keep @androidx.room.* class * { *; }
    -keepclassmembers class * {
        @androidx.room.ColumnInfo <fields>;
        @androidx.room.PrimaryKey <fields>;
    }
    
    # SQLCipher
    -keep class net.sqlcipher.** { *; }
    -keep,includedescriptorclasses class net.sqlcipher.** { *; }
    -keep,includedescriptorclasses interface net.sqlcipher.** { *; }
    
    # XXPermissions
    -keep class com.github.getactivity.xxpermissions.** { *; }
    
    # Retrofit
    -keep interface com.squareup.retrofit2.** { *; }
    -keepattributes *Annotation*
    -keepattributes Signature,Exceptions
    -keep class com.squareup.retrofit2.converter.gson.** { *; }
    
    # RxJava & RxAndroid
    -keep class io.reactivex.** { *; }
    -keep class io.reactivex.android.** { *; }
    
    # AndroidX
    -keep class androidx.core.** { *; }
    
  3. Configure permissions and register service in AndroidManifest.xml

    • Permission list

      <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
      <uses-permission android:name="android.permission.BLUETOOTH" />
      <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
      

Step 4: Connect Lovense toys and send commands


// Pass your token into the Lovense framework
Lovense.getInstance(getApplication()).setDeveloperToken("Your token");

// Enable or disable logging (default: false)
Lovense.getInstance(application).setLogEnable(true)

// Add a scan success notification
Lovense.getInstance(getApplication()).searchToys(new OnSearchToyListener() {
  @Override
  public void onSearchToy(LovenseToy lovenseToy) { } // Find toys

  @Override
  public void finishSearch() { }  // Scan finish

  @Override
  public void onError(LovenseError msg) { } // error

});

//Add a connection success notification
Lovense.getInstance(getApplication()).connectToy(toyId, new OnConnectListener() {
  @Override
  public void onConnect(String toyId,String status) { // Toy connection status
    switch (status) {
      case LovenseToy.STATE_CONNECTING:
        break;
      case LovenseToy.STATE_CONNECTED:
        break;
      case LovenseToy.STATE_FAILED:
        break;
      case LovenseToy.SERVICE_DISCOVERED:
        break;
    }
  }
  @Override
  public void onError(LovenseError lovenseError) {} // Connection error
 });

// Add sending command notification
Lovense.getInstance(getApplication()).addListener(toyId, new OnCallBack() {});

// Search for the toys over Bluetooth
Lovense.getInstance(getApplication()).searchToys(new OnSearchToyListener());

//Stop searching for toys
Lovense.getInstance(getApplication()).stopSearching();

// Save the toys
Lovense.getInstance(getApplication()).saveToys(lovenseToys, new OnErrorListener());

// Retrieve the saved toys
Lovense.getInstance(getApplication()).listToys(new OnErrorListener());

// Connect the toy
Lovense.getInstance(getApplication()).connectToy(toyId,new OnConnectListener());

// Disconnect the toy
Lovense.getInstance(getApplication()).disconnect(toyId);

// Get all supported commands of toy
Lovense.getInstance(getApplication()).getSupportedCommands(toyId);

// Send a command to the toy
Lovense.getInstance(getApplication()).sendCommand(toyId,CommandType.VIBRATE, vibrateLevel);

Command list

From the SDK version of 1.4.5, we suggest to use CommandType which contain all toy's commands

CommandDescription
VIBRATEVibrate the toy. The parameter must be between 0 and 20.
ROTATERotate the toy. The parameter must be between 0 and 20.
ROTATE_CLOCKWISERotate clockwise. The parameter must be between 0 and 20.
ROTATE_ANTI_CLOCKWISERotate anti-clockwise. The parameter must be between 0 and 20.
ROTATE_CHANGEChange the rotation direction
AIR_INAirbag inflation for n seconds. The parameter must be between 1 and 3.
AIR_OUTAirbag deflation for n seconds. The parameter must be between 1 and 3.
AIR_AUTOCycle airbag inflation for n seconds and air deflation for n seconds. The parameter must be between 0 and 3 (0 means stop).
VIBRATE1Activate the first vibrator at level n. The parameter must be between 0 and 20.
VIBRATE2Activate the second vibrator at level n. The parameter must be between 0 and 20.
VIBRATE_FLASHVibrate the toy at level n and flash the light at the same time.
FLASHFlash the light 3 times
LIGHT_OFFTurn off the light (saved permanently).
LIGHT_ONTurn on the light (saved permanently).
GET_LIGHT_STATUSGet the light's status (1: on, 0: off)
ALIGHT_OFFTurn off Domi/Domi 2 light (saved permanently)
ALIGHT_ONTurn on the Domi/Domi 2 light (saved permanently)
GET_ALIGHT_STATUSGet the Domi/Domi 2 light status (1: on, 0: off)
GET_BATTERYGet battery status
GET_DEVICE_TYPEGet device/toy information
START_MOVEStart tracking the toy movement (0-4)
STOP_MOVEStop tracking the toy movement
PRESETVibrate with a preset pattern. Patterns range from 1 to 10. n=0 will stop vibrations.
FLEXER_VIBRATEControl the vibration of Flexer. The parameter must be between 0 and 20.
FLEXER_FINGERControl the fingering motion of Flexer. The parameter must be between 0 and 20.
VIBRATE3Activate the third vibrator at level n. The parameter must be between 0 and 20.
THRUSTThrust the toy. The parameter must be between 0 and 20.
MULTIPLYControl three vibrators with different strength level for Lapis. Level range is 0 - 20, set level to -1 for remaining strength level from previous function.
SOLACEControl thrust and depth level separately for Solace. Level range is 0 - 20 for thrusting, and 1-3 for depth. Set level to 0 for thrusting will make the toy stop no matter what is the level value for depth. If the depth is not specified, the toy will act with the set thrusting level and default depth level value 1.
GET_TOUCH_MODEGet current mode from 'mission2' toy. The result will be one of [0, 1, 2, 3, 5].
SET_TOUCH_MODESet current mode to 'mission2' toy. The parameter must be one of [0, 1, 2, 3, 5]
GET_TOUCH_VALUEGet touch attenuation value from 'mission2' toy. That will return all level.
SET_TOUCH_VALUESet touch attenuation value to 'mission2' toy. The parameter level must be between 1 and 3, attenuation value must be between 0 and 100.
GET_TOUCH_LEVELGet touch attenuation level from 'mission2' toy. The result will be between 1 and 3.
SET_TOUCH_LEVELSet touch attenuation level to 'mission2' toy. The parameter must be between 1 and 3.
GET_SITEGet current position from the 'solacePro' toy.
SET_SITESet position to the 'solacePro' toy. The parameter must be between 0 and 100.
SPEEDThrust the 'solacePro' toy with fixed interval and a certain speed. Three parameters: speed, start and end. The parameter must be between 0 and 20.
START_FEEDBACKStart tracking the 'solacePro' toy movement. Return data : speed, direction and position.
STOP_FEEDBACKStop tracking the 'solacePro' toy movement.
GET_AUTO_SWITCHGet auto switch status via OnCallBackGetAutoSwitchListener. Returns two Int parameters: autoStop and reconnectToLastLevel, where each value is either 1 (on) or 0 (off)
SET_AUTO_SWITCHSet auto switch status with two parameters: 1 (on) or 0 (off). The IntArray consists of two values: [autoStop, reconnectToLastLevel].
OSCILLATEOscillate the toys of 'gush2' and 'osic3'. The parameter must be between 0 and 20.
SET_LIGHT_COLORSet the led light color to the 'lush4' toy. The parameter is LushLightColorType.value.
GET_LIGHT_COLORGet the led light color from the 'lush4' toy.

Callback list

CallbackDescription
OnSearchToyListenerFound toy list
OnConnectListenerToy connected status
OnSendCommandErrorListenerSend Command error, extends OnCallBack
OnCallBackBatteryListenerBattery status, extends OnCallBack. This is deprecated. Use OnCallBackBatteryV2Listener instead.
OnCallBackBatteryV2ListenerThis callback returns the current battery level and the working status of the device (isWork).
OnCallBackDeviceTypListenerDevice information, extends OnCallBack
OnCallBackLightStatusListenerLight indicator, extends OnCallBack
OnCallBackAidLightStatusListenerDomi/Domi 2 light indicator, extends OnCallBack
OnCallBackMoveListenerToy movement updates, extends OnCallBack
OnCommandSuccessListenerCommand success, extends OnCallBack
OnCommandErrorListenerCommand Error, extends OnCallBack
OnCallBackMission2ListenerAll command callbacks from 'mission2' toy
OnCallBackSolaceProListenerAll command callbacks from 'solacePro' toy
OnCallBackGetAutoSwitchListenerGet auto switch status, extends OnCallBack
OnLightColorListenerGet toy's led light colorType, extends OnCallBack (Lush4)

OnCallBackBatteryV2Listener

This callback returns the current battery level and the working status of the device (isWork).

  • battery: The current battery level.

  • isWork: Indicates whether the device is currently working (e.g., vibrating). When isWork is true, the battery level might be inaccurate due to ongoing device activity. In this case, the battery property of the Toy class will not be updated. When isWork is false, the battery level is considered accurate, and the Toy's battery property will be updated accordingly.

Toy Supported Commands list

NameVIBRATEVIBRATE1VIBRATE2VIBRATE3ROTATEROTATE_CLOCKWISEROTATE_ANTI_CLOCKWISEROTATE_CHANGEAIR_INAIR_OUTAIR_AUTOVIBRATE_FLASHFLASHLIGHT_OFFLIGHT_ONGET_LIGHT_STATUSALIGHT_OFFALIGHT_ONGET_ALIGHT_STATUSGET_BATTERYGET_DEVICE_TYPESTART_MOVESTOP_MOVEPRESETFLEXER_VIBRATEFLEXER_FINGERTHRUSTMULTIPLYGET_TOUCH_MODESET_TOUCH_MODEGET_TOUCH_VALUESET_TOUCH_VALUEGET_TOUCH_LEVELSET_TOUCH_LEVELSPEEDOSCILLATESET_LIGHT_COLORGET_LIGHT_COLORGET_SITESET_SITESTART_FEEDBACKSTOP_FEEDBACKGET_AUTO_SWITCHSET_AUTO_SWITCH
Ambi✓✓✓✓✓✓✓✓✓✓✓
Calor✓✓✓✓✓✓✓✓✓✓✓✓
Diamo✓✓✓✓✓✓✓✓✓✓
Dolce✓✓✓✓✓✓✓✓✓✓✓✓
Domi✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Domi2✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Edge✓✓✓✓✓✓✓✓✓✓✓✓
Edge2✓✓✓✓✓✓✓✓✓✓✓✓
Exomoon✓✓✓✓✓✓✓✓✓✓
Ferri✓✓✓✓✓✓✓✓✓✓
Flexer✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Gemini✓✓✓✓✓✓✓✓✓✓✓✓
Gravity✓✓✓✓✓✓✓✓✓✓✓✓✓
Gush✓✓✓✓✓✓✓✓✓✓
Gush2✓✓✓✓✓✓✓✓✓✓✓
Hush✓✓✓✓✓✓✓✓✓✓
Hush2✓✓✓✓✓✓✓✓✓✓
Hyphy✓✓✓✓✓✓✓✓✓✓
Lapis✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Lush✓✓✓✓✓✓✓✓✓✓
Lush2✓✓✓✓✓✓✓✓✓✓
Lush3✓✓✓✓✓✓✓✓✓✓
Lush4✓✓✓✓✓✓✓✓✓✓✓✓
Max✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Max2✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
MiniXMachine✓✓✓✓✓✓✓✓✓✓✓
Mission✓✓✓✓✓✓✓✓✓✓
Mission2✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Nora✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Osci✓✓✓✓✓✓✓✓✓✓✓
Osci2✓✓✓✓✓✓✓✓✓✓✓
Osci3✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Ridge✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Solace✓✓✓✓✓✓✓✓✓✓✓✓✓
SolacePro✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Tenera✓✓✓✓✓✓✓✓✓✓✓
Tenera2✓✓✓✓✓✓✓✓✓✓✓
Vulse✓✓✓✓✓✓✓✓✓✓✓✓
XMachine✓✓✓✓✓✓✓✓✓✓✓

Sync to Lovense patterns

After completing the Native SDK integration, you can easily build features that enable users to sync Lovense toys with media by utilizing the Pattern Playback methods. Support Android 4.3 and above.

Step 1: Initialization

Initialize the pattern player. Call this method every time you start to use the pattern syncing feature or when there is a change in the toy list.

Note: This method only needs to be called once during the whole process.

ParametersDescriptionTypeRequired
toyIdThe list of connected toys’ id.List<String>Required
pfYour platform’s name. Contact us if you aren’t sure about this.StringRequired
lovense.setupPatternPlayerWithToyIds(toyIds, pf);

Step 2: Load Pattern

Load the pattern of the media to be played. Call this method every time you open a media page or switch media.

ParametersDescriptionTypeRequired
mediaIDThe media’s ID from your platform.StringRequired
lovense.prepareForPatternWithMediaID(mediaId, new OnPrepareCallback() {
    @Override
    public void onComplete() {

    }

    @Override
    public void onError(String errorMsg) {

    }
});

Step 3: Play Pattern

ParametersDescriptionTypeRequired
currentTimeThe playing time duration so far. The default is 0. (in ms)LongOptional
totalTimeThe total time of media. (in ms)LongRequired
lovense.playPattern(currentTime, totalTime);

Step 4: Sync with Media

If the rate or progress changes while playing the media, call the following methods to re-sync the rate and time.

ParametersDescriptionTypeRequired
rateThe playback rate. The default is 1.0.FloatOptional
lovense.setRate(rate);
ParametersDescriptionTypeRequired
currentTimeThe playing time duration so far. (in ms)LongRequired
lovense.syncCurrentTime(position);

Pause the pattern when the media is paused or loading, so the toy’s reaction matches the media content.

lovense.pause();

Calling this method will pause the playing and reset the time to 0.

lovense.stop();
Last Updated:
Explore our Forum or Support to get more inspiration or solve your problems.
Discord Channel
It is an online real-time channel where you can communicate directly with our official administrators or many excellent developers.
Forum
It is a place for Lovense developers to communicate, where you can find solutions to problems or get inspired for your projects.
Support
Find documents and tutorials that may be helpful to you.