This feature is only available for versions lower than 1.3.0.0, Versions 1.3.0.0 and above support multi-process reporting by default.
If your application has multiple processes and you need to report data from several processes, please configure the SolarEngineConfig by setting supportMultiProcess to true and then follow the multi-process configuration guidelines in this document.
Once multi-process support is enabled, each process must call the SDK initialization.
Step 1:
Please configure the provider to enable multi-process support in the application's AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name">
<provider android:authorities="${applicationId}.solar.engine.provider"
android:name="com.reyun.solar.engine.db.SolarEngineContentProvider"
android:multiprocess="true"
android:permission="${applicationId}.permission.SolarEngineContentProvider"
android:exported="false"/>
</application>
</manifest>
The `${applicationId}` placeholder will be automatically replaced with your application's package name during compilation, so no modifications are necessary here.
Step 2:
Please configure the permissions required for multi-process support in the application's AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<permission android:name="${applicationId}.permission.SolarEngineContentProvider"
android:protectionLevel="signature"/>
</manifest>
The `${applicationId}` placeholder will be automatically replaced with your application's package name during compilation, so no modifications are necessary here.
This permission is a custom permission and does not pose any privacy risks.
Step 3: Verify whether the configuration is correct.
After completing the configurations above, launch the application. Filter logcat by SolarEngineSDK.Global, and if you see the following log, it means the configuration was successful:
SolarEngineSDK init success by appKey: {your app key} sessionId: {current session id} package: {your package name} isMainProcess: {main process} isSupportMultiProcess: true isDebug:{debug state} isContentProviderAvailable: true
If isSupportMultiProcess is true, it indicates that supportMultiProcess is configured in SolarEngineConfig; otherwise, please check supportMultiProcess. If isContentProviderAvailable is true, it indicates that the configuration in AndroidManifest.xml is correct.
Step 4:
Configuration complete. Please report the event in another process.