Menu

Quick Access

1.  SDK Basic Information

SDK Name: SolarEngine Android SDK v1.3.1.1

Developer: Mobvista Cloud (Beijing) Technology Co., Ltd.

SDK Version: 1.3.1.1

Description: SolarEngine (SE) is an all-in-one mobile app growth analytics and data intelligence platform. It supports data management across global channels, assisting developers to monitor every stage of business development. With our attribution tracking and user-granular ROI analysis, you'll be able to measure the true value every channel creates and optimize future growth strategies. SE also offers various analysis models and A/B testing feature to help fully visualize the user journey, identify potential pain points, implement targeted product enhancements and ultimately drive large-scale app growth.

Privacy Policy:  https://www.solar-engine.com/privacyPolicyEN.html

Compliance Guideline: https://help.solar-engine.com/en/docs/Compliance-Guideline

Note:

The SolarEngine SDK supports Android 5.0(APILevel 21) and above.


2.  Procedures

Please follow the directions below to get prepared.

Step 1: Get AppKey

Access Path: Asset Management - App Management - AppKey

Step 2: Obtain SDK & SDK Demo

a. Maven repository config

The maven repository configuration needs to be added to the build.gradle file in the project root directory as follows:

repositories {
   google()
   jcenter()
   mavenCentral()
   
   //SE SDK repository address
   maven {  url "https://maven-android.solar-engine.com/repository/se_sdk_for_android/"}
   maven { url "https://developer.huawei.com/repo/" }
   maven { url "https://developer.hihonor.com/repo/" } 
}
Note: In the root directory's build.gradle, the repositories under both buildscript and allprojects need to be configured with the Maven repository address.

b. Obtain SDK

To obtain the SDK using the Gradle build system, please add the following code to the build.gradle file of your project.

implementation 'com.reyun.solar.engine.oversea:solar-engine-core:1.3.1.1'

c. Obtain SDK Demo

        Please download via SDK Demo

If you meet errors like "com.hihonor.ads.identifier.AdvertisingIdClient$Info is defined multiple times", please exclude HUAWEI and HONOR OAID library,:

implementation 'com.reyun.solar.engine.china:solar-engine-core:1.3.1.1' 

{

    exclude group: 'com.huawei.hms', module: 'ads-identifier'

    exclude group: 'com.hihonor.mcs', module: 'ads-identifier'

}


Step 3: Configure AndroidManifest

Locate the file AndroidManifest.xml in your project and add the following permissions:

//Network related permissions (necessary)
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

//Phone state permissions (optional)
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Note: The android.permission.READ_PHONE_STATE is a non-essential permission. If you need this permission to collect IMEI and the Android system is version 6.0 or higher, you will need to dynamically request this permission and get user consent.

Code obfuscation

If obfuscation is required during packaging, please add the following code to the obfuscation configuration file.

-keep class com.reyun.** {*; }
-keep class route.**{*;}
-keep interface com.reyun.** {*; }
-keep interface route.**{*;}
-dontwarn com.reyun.**
-dontwarn org.json.**
-keep class org.json.**{*;}
# Google lib
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
    com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
    java.lang.String getId();
    boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }
# If the OAID plugin is used, please add the following obfuscation strategy:
-keep class com.huawei.hms.**{*;}
-keep class com.hihonor.**{*;}

       If you are using the special version SDK provided for Transsion, please add the following code to the obfuscation configuration file.

-keep class com.se.** {*; }
-keep class route.**{*;}
-keep interface com.se.** {*; }
-keep interface route.**{*;}
-dontwarn com.se.**
-dontwarn org.json.**
-keep class org.json.**{*;}
# Google lib
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
    com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
    java.lang.String getId();
    boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }
# If the OAID plugin is used, please add the following obfuscation strategy: 
-keep class com.huawei.hms.**{*;}
-keep class com.hihonor.**{*;}

Step 4: SDK Initialization

When the application is first launched after install, the SDK is initialized. During this time, the SDK does not collect any personal information or report data to SolarEngine.

Please ensure that the user has agreed to the Privacy Policy before you call other function.

Function

public synchronized void preInit(Context context, String appKey)

Parameter Description

ParameterDescriptionTypeRequired
contextThe context of the applicationContextYes
appKeyAppKey obtained in Step 1StringYes

Sample Code

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().preInit(context, "Appkey");

     If you have enabled local debugging logs and see "solar engine sdk preInit success", it means that the SDK has been successfully pre-initialized.

Step 5: Set SDK Config (optional)

If not set, it will return the default values.

Function

SolarEngineConfig config = new SolarEngineConfig.Builder()
.logEnabled()   //Enable local debugging logs
.build();

Sample Code

import com.reyun.solar.engine.SolarEngineConfig; 

SolarEngineConfig config = new SolarEngineConfig.Builder() 
.logEnabled()
.build();

Parameter Description

ParameterDescriptionTypeRequired
logEnabledWhether to enable debugging logs (Default False)voidno
enable2GReportingWhether to enable data reporting in 2G environment (Default False)booleanno
isDebugModelWhether to enable Debug mode (Default False). Before using, please check function description.booleanno
isGDPRAreaIf your product is operated within the EU region, there will be GDPR restrictions to follow. Please make sure to set isGDPRArea(true) if users reject the device information collection. (Default False)booleanno
adPersonalizationEnabledIf your product is operated within the EU regions and advertised on Google, please send the results about whether users allow Google to use their data for ad personalization into this parameter, so that you will comply with Google's EU user consent policy.  (Default False)booleanno
adUserDataEnabledIf your product is operated within the EU regions and advertised on Google, please send the results about whether users allow their personal data to be shared with Google into this parameter, so that you will comply with Google's EU user consent policy.  (Default False)booleanno
setCoppaEnabledIf your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"), please set "setCoppaEnabled = true".booleanno
setKidsAppEnabledIf your app is targeting kids under 13 years old, please mark your app as "Kids App" category and set "setKidsAppEnabled = true.booleanno
setFbAppIDIf overseas developers need to use meta attribution, set meta appid here.Stringno
enableDelayDeeplinkWhether to enable deferred deep linking, default False. deprecated, see enableDeferredDeeplinkbooleanno
enableDeferredDeeplinkWhether to enable deferred deep linking, default Falsebooleanno
supportMultiProcessWhether to enable multi-process support, default false, meaning it is not enabled. This feature has been supported since version v_1.2.9.4. If you need to use multiprocessing capabilities, please upgrade the SDK to version v_1.2.9.4 or later. If this property is set to true, please refer to Config multi process booleanno
isOAIDEnabledWhether to enable OAID collection (default false)booleanno
isImeiEnabledWhether to enable IMEI collection (default false)booleanno
isAndroidIDEnabledWhether to enable Android ID collection (default false)booleanno
withDisableOAIDRetryWhether to disable OAID retrieval retry, default is falsebooleanno
withDisableGAIDRetryWhether to disable GAID retrieval retry, default is falsebooleanno

Step 6: Use SDK

Please initialize the SE SDK in the Application's onCreate() method.

This method must be called before any other methods, otherwise they will be invoid. Only methods for setting public event properties, setting the channel, and setting preset event properties can be called without prior initialization.

Function

public synchronized void initialize(Context context, String appKey, SolarEngineConfig config,OnInitializationCallback onInitializationCallback)

Parameter Description

ParameterDescriptionTypeRequired
contextThe context of the applicationContextYes
appKeyAppKeyStringYes
configCan be blank. Default value if blank.SolarEngine ConfigNo
OnInitializationCallbackInitialization CallbackOnInitializationCallbackNo

Sample Code

import com.reyun.solar.engine.SolarEngineManager;
import com.reyun.solar.engine.SolarEngineConfig;
SolarEngineConfig config = new SolarEngineConfig.Builder().build(); 
SolarEngineManager.getInstance().initialize(context, "Appkey",config, new OnInitializationCallback() {
     @Override
     public void onInitializationCompleted(int code) {
            if(code == 0) {
                 //Initialization success
            } else {
                //Initialization failed, please check the code table below for specific failure reason
            }
     }
});

     If you have enabled local debugging logs and see "solar engine SDK Init success", it means that the SDK has been successfully initialized.

Initialization Callback Code:

0Initialization success
101SDK is not pre-initialized
102illegal appkey
103null context
104failed generating distinct_id
105excpetion occurred during initialization

Step 7: Get Attribution Results

1)Get attribution results through callbacks

Function

SolarEngineConfig config = new SolarEngineConfig.Builder().build();
config.setOnAttributionListener(new OnAttributionListener() {
        @Override
        public void onAttributionSuccess(JSONObject attribution) {
             //Performed when the attribution results are successfully obtained
        }

        @Override
        public void onAttributionFail(int errorCode) {
            //Performed when the attribution results are not obtained
        }
   });

Sample Code

import com.reyun.solar.engine.SolarEngineConfig;

SolarEngineConfig config = new SolarEngineConfig.Builder().build();
config.setOnAttributionListener(new OnAttributionListener() {
        @Override
        public void onAttributionSuccess(JSONObject attribution) {
             //Performed when the attribution results are successfully obtained
        }

        @Override
        public void onAttributionFail(int errorCode) {
            //Performed when the attribution results are not obtained
        }
   });
  SolarEngineManager.getInstance().initialize(getApplicationContext(),"appkey",config)

Note:

       If developers want to obtain attribution information during SDK initialization, the attribution information callback plugin should be bound to the SDK initialization method. Otherwise, it may result in inaccurate attribution information. Please refer to the above code example for specific implementation details.

2) Get Attribution Results Directly

       Developers can also directly call and retrieve attribution information after SDK initialization. However, please note that this method returns local cache only. If the local cache has not been generated yet, the attribution result will be null.

Function

public JSONObject getAttribution();

Returned Value: Return the attribution result information (default null).

Sample Code

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;

JSONObject attribution = SolarEngineManager.getInstance().getAttribution();


Attribution error code descriptions and detailed attribution results can be found in:  

https://help.solar-engine.com/en/docs/SDK-Attribution-Result-Details

Previous
Android SDK
Next
Optional Features
Last modified: 2025-09-16Powered by