Menu

Quick Access

SDK Basic Information

SDK Name: SolarEngine Android SDK v1.3.4

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

SDK Version: 1.3.4

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.


Step 1: Get AppKey

Access Path: Asset Management - App Management - AppKey

Step 2: Obtain SDK & Demo

Note: This method does not apply for apps on Transsion appstore. If you need to publish on Transsion appstore, please contact your customer manager for assistance.

a. Maven repository config

Please add the maven repository configuration 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/" } 
}

     If the download from the above address maven-android-cn.solar-engine.com fails, you can try using the backup address below:

https://maven-android-cn.solar-engine.com/repository/se_sdk_for_android/

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.

If your product data storage area is in China Mainland, please use:

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

     If your product data storage area is in Non China Mainland, please use:

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

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.4'
{
  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.**{*;}

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: SolarEngineConfig (optional)

SolarEngineConfig parameter description

    This configuration class is used to fine‑tune service capabilities and data‑collection behaviors during SDK initialization. Its parameters fall into three categories: core‑feature switches, auxiliary feature switches, and data collection switches.

    The config returned by this method is optional. If not set, the default values will be applied.

Sample Code

import com.reyun.solar.engine.SolarEngineConfig; 

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

1. Core Feature Switches

    It controls the enablement or disablement of core SDK capabilities, directly determining whether core services such as attribution and analytics take effect.

    Note: Disabling relevant core feature switches will disrupt the data reporting. You will no longer be able to fully utilise all functions within SolarEngine dashboard.

MethodData TypeRequiredDescription
enableAttributionbooleanNoWhether to enable SolarEngine attribution service. Enabled by default. Disabling it will turn off all attribution relevant capabilities, including attribution results, deferred deeplinks and deeplinks, etc. If the analytics service is disabled at the same time, the SDK will stop reporting all data.
enableAnalyticsbooleanNoWhether to enable SolarEngine analytics service. Enabled by default. Disabling it can make all analytics features unavailable, such as A/B testing and online parameter. If the attribution service is disabled at the same time, the SDK will stop reporting all data.

2. Auxiliary Feature Switches

ParameterTypeRequiredDescription
logEnabledvoidNoWhether to enable local debug logs. Disabled by default.
enable2GReportingbooleanNoWhether to report events in 2G network. Disabled by default.
isDebugModelbooleanNoWhether to enable debug mode. Disabled by default. Before using, please check function description.
isGDPRAreabooleanNoIf 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. Disabled by default.
adPersonalizationEnabledbooleanNoIf your product is operated within the EU regions and advertised on Google Ads, please send the results about whether users allow Google Ads to use their data for ad personalization into this parameter, so that you will comply with Google's EU user consent policy. Disabled by default.
adUserDataEnabledbooleanNoIf 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. Disabled by default.
setCoppaEnabledbooleanNoIf your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"), please set "setCoppaEnabled = true".
setKidsAppEnabledbooleanNoIf your app is targeting kids under 13 years old, please mark your app as "Kids App" category and set "setKidsAppEnabled = true.
setFbAppIDStringNoIf you need to enable Meta attribution on SolarEngine, please set meta appid here.
enableDeferredDeeplinkbooleanNoWhether to enable deferred deeplink. Disabled by default.
supportMultiProcessbooleanNoWhether to enable multi-process support. Disabled by default. This feature has been supported since version v_1.2.9.4. If you need to use it, please upgrade SDK version to v_1.2.9.4 or later.

If this property is set to true, please refer to Config multi process.
enableSeparatedAttributionbooleanNoWhether to enable new attribution feature. After enabled, corresponding attribution results can be retrieved quickly.

3. Data Collection Switches

    It controls whether data such as IPv6, OAID and UA is collected.

    Note: Disabling corresponding data collection parameters will impair attribution and analytics services, and you will not be able to use relevant functions normally on SolarEngine dashboard.

MethodTypeRequiredDescription
enableLanguagebooleanNoWhether to collect device language. Set to false to disable collection. Default true (enabled).
enableLocalebooleanNoWhether to collect device locale. Set to false to disable collection. Default true (enabled).
enableTimeZonebooleanNoWhether to collect device time zone. Set to false to disable collection. Default true (enabled).
enableScreenWHbooleanNoWhether to collect screen width and height. Set to false to disable collection. Default true (enabled).
enableDensitybooleanNoWhether to collect screen density. Set to false to disable collection. Default true (enabled).
enableNetworkTypebooleanNoWhether to collect network status. Set to false to disable collection. Default true (enabled).
enableUAbooleanNoWhether to collect User-Agent (UA). Set to false to disable collection. Default true (enabled).
isOAIDEnabledbooleanNoWhether to collect OAID. Set to false to disable collection.
isImeiEnabledbooleanNoWhether to collect IMEI. Set to false to disable collection.
isAndroidIDEnabledbooleanNoWhether to collect Android ID. Set to false to disable collection.
enableIPV6AddressbooleanNoWhether to collect IPv6 address. Default true (enabled). Supported in China Mainland only.
withDisableOAIDRetrybooleanNoWhether to disable OAID retry. Default false.
withDisableGAIDRetrybooleanNoWhether to disable GAID retry. Default false.

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)【New】Get attribution results through callbacks

Sample Code

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

// Enable new attribution feature. (Note: if not set, subsequent callbacks will not return data)
builder.enableSeparatedAttribution(true);
// Monitor new user attribution results
config.setUAAttributionListener(new OnAttributionListener() {
        @Override
        public void onAttributionSuccess(JSONObject attribution) {
             //Action on successful attribution result retrieval     
        }
        @Override
        public void onAttributionFail(int errorCode) {
            //Action on failed attribution result retrieval
        }
});

// Monitor re-targeting attribution results
config.setREAttributionListener(new OnAttributionListener() {
        @Override
        public void onAttributionSuccess(JSONObject attribution) {
             //Action on successful attribution result retrieval 
        }
        @Override
        public void onAttributionFail(int errorCode) {
            //Action on failed attribution result retrieval
        }
});

SolarEngineManager.getInstance().initialize(getApplicationContext(),"appkey",config)
Important: For callback‑based attribution result retrieval, configure attribution listeners prior to invoking initialize. Defining listeners post‑initialization may cause imprecise attribution data. See the sample code above.

2) 【New】Get Attribution Results Directly

       In addition to setting attribution callbacks at initialization, attribution results can be retrieved by calling the API proactively in subsequent business processes.

Important: This API retrieves device local cached data and returns "null" when cache generation is incomplete.

Sample Code

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

// Get new user attribution data
JSONObject uaAttribution = SolarEngineManager.getInstance().getUAAttributionData();

// Get re-targeting attribution data
JSONObject reAttribution = SolarEngineManager.getInstance().getREAttributionData();


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: 2026-09-20Powered by