Manual Integration¶
How to Integrate the SDK Without Using ft-plugin¶
TrueWatch uses Android Gradle Plugin Transformation to implement code injection, thereby achieving automatic data collection. However, due to some compatibility issues, there may be situations where ft-plugin or ft-plugin-legacy cannot be used. The affected scope includes:
ActionandResourcein RUM- Automatic capture of
android.util.Log - Automatic capture of Java and Kotlin
printlnconsole logs - Automatic upload of symbol files
Currently, for this situation, a manual integration solution can be adopted.
Application Startup Event¶
Refer to the source code example DemoForManualSet.kt.
Manually Adding User Actions¶
Events such as button clicks need to be added manually at the trigger point. Here is an example using a Button onClick event. Refer to the source code example ManualActivity.kt:
Manual Integration for OkHttp Resource / Trace¶
OkHttp can integrate Resource and Trace through addInterceptor and eventListener. The example is as follows. Refer to the source code example ManualActivity.kt:
OkHttpClient.Builder builder = new OkHttpClient.Builder()
.addInterceptor(new FTTraceInterceptor())
.addInterceptor(new FTResourceInterceptor())
.eventListenerFactory(new FTResourceEventListener.FTFactory());
//.eventListenerFactory(new FTResourceEventListener.FTFactory(true));
OkHttpClient client = builder.build();
Other network frameworks require implementing FTRUMGlobalManager.startResource, stopResource, addResource, and FTTraceManager.getTraceHeader manually. For specific implementation methods, refer to the source code example ManualActivity.kt.