Setting custom Activity Markers
Activity markers are events that occur in an application during runtime.
Activity lifecycle events are automatically captured by Finotes.
Follow the steps in Track Jetpack Compose to track lifecycle events of Jetpack compose screens.
Developers can set custom activity markers anywhere in the app using Fn.setActivityMarker(). These markers will be shown along with the lifecycle events, when an issue is reported.
Activity markers are displayed in their chronological order.
There is no limit to the number of custom markers that can be set by the developer. Only when an issue is raised, these activity markers are sent to the server.  
Call anywhere in your project:
- Java
 - Kotlin
 
Fn.setActivityMarker(PurchaseActivity.this, "clicked on payment_package_two");
Fn.setActivityMarker(this@PurchaseActivity, "clicked on payment_package_two")
How activity trail will look like along with reported issue in Finotes dashboard:
ActivityWelcome:onCreate                            11:19:24:469    45.79% FREE MEMORY 
MapActivity:onCreate                                11:19:24:708    44.39%
MapActivity:onStart                                 11:19:26:983    45.55%
MapActivity:onResume                                11:19:27:012    45.19%
ActivityWelcome:onDestroy                           11:19:28:515    44.53%
MapActivity:onPause                                 11:20:17:806    50.45%
PurchaseActivity:onCreate                           11:20:18:106    55.19%
PurchaseActivity:onStart                            11:20:18:404    55.43%
PurchaseActivity:onResume                           11:20:18:906    55.23%
PurchaseActivity:clicked on payment_package_two     11:20:24:235    55.20%
Debug level Activity Markers
Developers can set custom activity markers that are active only in debug builds of the app. This can be achieved using Fn.setActivityMarkerForDebug API.
These markers are not captured in release or production builds.
Call anywhere in your project:
- Java
 - Kotlin
 
Fn.setActivityMarkerForDebug(this, "User opened invoice");
Fn.setActivityMarkerForDebug(this@PurchaseActivity, "User opened invoice")
Obfuscated Activity Trail
When using proguard or other obfuscation tools, the class name in activity trail may be obfuscated.
In order to display meaningful class names in activity trail, developers can set a custom id using @Observe annotation to any class.  
Once set 'id' will be shown instead of the obfuscated class name.
Make sure to provide a hardcoded string value to 'id' parameter of @Observe annotation.  
Any non-Activity Class:
- Java
 - Kotlin
 
@Observe(id = "GalleryFragmentClass")
public class GalleryFragment extends Fragment {
                                    
@Observe(id = "GalleryFragmentClass")
class GalleryFragment: Fragment() {