top of page
  • Writer's pictureDon Peter

Why do we need to monitor features for failures in Android apps?

Updated: Sep 25, 2022


We all know how difficult it is to build an app from scratch. In fact, you might be in the middle of building an app as you read this blog post. From working on the basic idea, conducting market research, deciding on the platform, fixing bugs at the development time, testing the beta version and finally releasing it, each process is tedious and time-consuming.


Then you spend a lot of time formulating various digital marketing and outreach initiatives to market your app and finally succeed in attracting users to sign up and use the app. But then, a section of users start complaining that the crucial feature in your mobile app fails.


Understandably, you would now be in a hunt to find out what could’ve gone wrong. But in most cases, you may not even be able to reproduce the issue or to identify where exactly the issue occurred in the code because of lack of data points.


Identifying the issue before app users report them

Now the question is, is there a way to identify such failures even before the users start leaving poor reviews on play store?


This is where the feature tracking mechanism in Finotes comes in handy. With feature tracking enabled, Finotes SDK will notify developers when a tracked app feature fails.

How does Finotes report such feature failures?

Making use of feature tracking API, developers will be able to chain multiple functions and track feature failures in Android apps for failures.

Infographics image which shows overview of how Finotes SDK help to report feature failures
Overview of how Finotes SDK help report feature failures

Let us consider the example of an application like WhatsApp or Facebook messenger that allows users to chat with each other. In order to track its messaging feature, we chain the send and receiveAcknowledgement functions in our codebase using the API provided by the SDK.


Once chained, Finotes will monitor if the end function is triggered after the execution of the start function within the expected time which can be set by the developer with milliseconds precision. In case the end function is not executed within the expected time, Finotes will report it as an issue to the dashboard immediately.


Java code snippet on how to chain start and end functions of a feature using the Fn.call() API and @Observe annotation provided by the SDK


    // Function to be executed when user types a text message and clicks on send button.
    // Replace traditional function call with Fn.call() API.
    Fn.call("messageTextFromUser", ChatActivity.this,         
                                    chatEditText.getText());
}
 
// By using @Observe annotation, chain the start function 'messageTextFromUser' and the end function 'messageSentSuccessfully'. Finotes will raise an issue report if the end function is not executed within the expected execution time.
 
@Observe(nextFunctionId = "messageSentSuccessfully",
            nextFunctionClass = ChatActivity.class,
        expectedChainedExecutionTime = 5000)                            
public void messageTextFromUser(String message){
    ...
}



    // Function to be executed once the text message is successfully sent.
    // Replace traditional function call with Fn.call() API.              
    Fn.call("messageSentSuccessfully", ChatActivity.this,         
                                    conversationIdentifier);
}
                                    
public void messageSentSuccessfully(Object conversationId){
    ...
}
    

Kotlin code snippet on how to chain start and end functions of a feature using the Fn.call() API and @Observe annotation provided by the SDK


    // Function to be executed when user types a text message and clicks on send button.
    // Replace traditional function call with Fn.call() API.
    Fn.call("messageTextFromUser", this@ChatActivity,         
                                    chatEditText.getText())
}
   
// By using @Observe annotation, we chain the start function 'messageTextFromUser' with the end function 'messageSentSuccessfully'. Finotes will raise an issue report if the end function is not executed within the expected execution time.
                                                                
@Observe(nextFunctionId = "messageSentSuccessfully",
            nextFunctionClass = ChatActivity::class,
        expectedChainedExecutionTime = 5000)                               
fun messageTextFromUser(message :String){
    ...
}
    

    
    // Function to be executed once the text message is successfully sent.
    // Replace traditional function call with Fn.call() API.        
    Fn.call("messageSentSuccessfully", this@ChatActivity,         
                                    conversationIdentifier)
}
                                    
fun messageSentSuccessfully(conversationId :Object){
    ...
}
    

Please find our detailed Android documentation to find out how to chain functions to track feature failures.


In-depth data points to reproduce and fix the issue

The activity trail which is a chronologically ordered list of app events along with function parameters that were passed to the tracked function at runtime will help identify the root cause of the issue.


Apart from these, data points like device and device state data will also be included with every issue report. These in-depth data points will enable developers to reproduce the issue and fix them fast.

Finotes is capable of detecting feature failures in iOS and watchOS apps. Apart from feature failures, SDK is capable of detecting and reporting crashes, API call issues, frame rate issues, ANR, function failures, memory leaks, abnormal memory usage, exceptions and custom issues.

Finotes is available for Android as Java & Kotlin SDK, iOS as Objective- C & Swift Framework and watchOS as Objective-C & Swift Framework.


Visit finotes.com to learn more about Finotes. Detailed documentation is available at docs.finotes.com.

Blog for Mobile App Developers, Testers and App Owners

 

This blog is from Finotes Team. Finotes is a lightweight mobile APM and bug detection tool for iOS and Android apps.

In this blog we talk about iOS and Android app development technologies, languages and frameworks like Java, Kotlin, Swift, Objective-C, Dart and Flutter that are used to build mobile apps. Read articles from Finotes team about good programming and software engineering practices, testing and QA practices, performance issues and bugs, concepts and techniques. 

bottom of page