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.
Please follow the directions below to get prepared.
Access Path: Asset Management - App Management - AppKey
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.
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'
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'
}
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.
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.**{*;}
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
Parameter | Description | Type | Required |
---|---|---|---|
context | The context of the application | Context | Yes |
appKey | AppKey obtained in Step 1 | String | Yes |
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.
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
Parameter | Description | Type | Required |
---|---|---|---|
logEnabled | Whether to enable debugging logs (Default False) | void | no |
enable2GReporting | Whether to enable data reporting in 2G environment (Default False) | boolean | no |
isDebugModel | Whether to enable Debug mode (Default False). Before using, please check function description. | boolean | no |
isGDPRArea | If 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) | boolean | no |
adPersonalizationEnabled | If 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) | boolean | no |
adUserDataEnabled | If 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) | boolean | no |
setCoppaEnabled | If your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"), please set "setCoppaEnabled = true". | boolean | no |
setKidsAppEnabled | If your app is targeting kids under 13 years old, please mark your app as "Kids App" category and set "setKidsAppEnabled = true. | boolean | no |
setFbAppID | If overseas developers need to use meta attribution, set meta appid here. | String | no |
enableDelayDeeplink | Whether to enable deferred deep linking, default False. deprecated, see enableDeferredDeeplink | boolean | no |
enableDeferredDeeplink | Whether to enable deferred deep linking, default False | boolean | no |
supportMultiProcess | Whether 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 | boolean | no |
isOAIDEnabled | Whether to enable OAID collection (default false) | boolean | no |
isImeiEnabled | Whether to enable IMEI collection (default false) | boolean | no |
isAndroidIDEnabled | Whether to enable Android ID collection (default false) | boolean | no |
withDisableOAIDRetry | Whether to disable OAID retrieval retry, default is false | boolean | no |
withDisableGAIDRetry | Whether to disable GAID retrieval retry, default is false | boolean | no |
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
Parameter | Description | Type | Required |
---|---|---|---|
context | The context of the application | Context | Yes |
appKey | AppKey | String | Yes |
config | Can be blank. Default value if blank. | SolarEngine Config | No |
OnInitializationCallback | Initialization Callback | OnInitializationCallback | No |
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:
0 | Initialization success |
101 | SDK is not pre-initialized |
102 | illegal appkey |
103 | null context |
104 | failed generating distinct_id |
105 | excpetion occurred during initialization |
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.
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