Loading...
Home
  • Tech Blogs
  • Videos
  • Conferences
    • Droidcon News
    • Upcoming Conferences
    • Become a Partner
    • Past Events
    • Keep Me Informed
    • Diversity Scholarships
  • Community
    • droidcon Team
    • How to Hold a Droidcon
  • Android Careers
Sign In

Global CSS

 

Solve mobile production issues like a Sherlock

How to solve mobile production issues without losing your mind 😱

 

 
Asidahan
Android Developer @ zattoo
Published: March 30, 2021
Tweet
Share
 

 

I assume that most of you (I’m talking about you, mobile developers) had to deal with production issues like crashes, bugs, and unexpected app behavior at some point in your career.
Ok… now you have a production issue that happens to many users (possibly millions) with different devices, different OS versions, different countries, and the list goes on and on.
So how are you supposed to approach this issue? Where should you start looking?

 

A Story tell

To demonstrate how to approach production issues, I’ll walk you through a story, so it will be easier for you to understand.
Imagine a developer that has a stock trading app that allows users to buy/sell stocks.
All of a sudden, the analytics system (like Google Analytics) is showing a decline in users' lifetime. Further investigation reveals that the last event from these short-lived users is “show-stock-info-event, which occurs when a user clicks on a stock to see more information about it.

 

 

The first thing the developer probably does is check in the logs of the crash monitoring system and after hours of checking, you finally found something that according to the stack trace might be related to the info screen but you’re not sure.

The next thing that he does is try to reproduce it by himself but he fails to do it and he doesn't understand what is the flow that users go through that causes the app to crash.
So what does he do now? How does he go from here? Will he need to stay up all night again and eat pizzas at work?
Don't worry! I’m going to share with you a few tips that will really help him and you.

 

Few useful tips

Before continuing with our story, I would like to give you a few tips that will help to investigate production issues:

  1. Determine the severity of the issue:
    - What is the scale of the issue? does it happen to a lot of users or just a few?
    - Does it have the potential to escalate and become bigger?
    - Does it affect the performance of the app?
    - Does it affect battery consumption/available storage?
    - Does it affect the business?
    - Do the users see the issue or do it happen in the background?
  2. You can implement Thread.UncaughtExceptionHandler and handle uncaught exceptions right before they are thrown.
    This must be done carefully otherwise this can lead to memory leaks and other maladies:
    https://chaosinmotion.com/2011/05/15/on-memory-leaks-in-java-and-in-android/
  3. If you cannot reproduce the issue, try to look at the wider picture and think about how users use your app? Maybe they get a phone call or send a message while using your app
  4. For you to be able to track users more easily in your crash monitoring system, you can add to your crash logs a custom key with something that identifies the users uniquely. For example, we use Firebase, thus we add to the logs a user id that will be associated with the crash.

 

Story continues…

The first thing that you need to do is to determine the severity of the issue. You see in your analytics system that this issue happens to many users and because it affects stock trading it also affects the business.

Let’s say that you’ve sent the user’s id as a custom key to your crash monitoring system, and you found that one of these users’ IDs was also found in a crash related to the info screen.
But, when you try to reproduce it with the same flow that the users did, the crash doesn’t happen and you’re wondering how is that possible.

You start to think, maybe when users want to see info about the stocks, they will probably want to see it wider because it’s more convenient to see charts horizontally, so they will probably rotate the screen.
You start checking the flow again, but this time you rotate the screen right after you go to the info screen, and… it crashes!
Suddenly you realize you forgot to restore the state after screen rotation and when the users rotate the screen, there is no data to show and you get NPE.

Now you handle saving/restoring the state, fix the bug, run all tests again, and… Congratulations! the crash doesn’t happen again.

 

Summary

All the production issues, as hard as they might seem, usually share common things, and following the tips I gave you can really help in investigating most of them.

Hope you enjoyed reading my article and that the tips I gave and the mindset I introduced, will really help you next time a production issue will come your way! 😊

 

 

 

View original article at: 


 

Originally published: Marh 25, 2021

Android News
Getting… your BottomSheetScaffold working on Jetpack Compose Beta 03
Getting… your BottomSheetScaffold working on Jetpack Compose Beta 03

By Carlos Mota

It’s Monday, no releases this week, and… there’s a new version of Jetpack Compose — beta 03—available. What a perfect time to just increment 02 to 03 and see what’s new. The API is (almost) final so after updating from alpha to beta there weren’t any big changes to do. However, and remember that’s still in development, there’s always something that I need to update. 

By ProAndroidDev -
Android News
Noisy Code 🗣 With Kotlin Scopes
Noisy Code 🗣 With Kotlin Scopes

By Chetan Gupta

Scopes make your code more readable? think again... You are going to encounter these scope functions namely let, run, apply, also, within every Kotlin codebase, along with all the mischievous ways developers exploit their usage from the way they were intended for. Let see how popular opinion on those ends up just as a code noise.

By ProAndroidDev -
Android News
Improving Android DataBinding with Bindables library
Improving Android DataBinding with Bindables library

By Jaewoong Eum

DataBinding is one of the most important factors for MVVM architecture. The basic concept of DataBinding is to link the view and view model via observer patterns, properties, event callbacks, etc. Linking and automating communication between the view via the bound properties or something in the view model has a lot of benefits in the MVVM architecture concept.

By ProAndroidDev -
Android News
KMM QuickStart Guide
KMM QuickStart Guide

By Mayank Kharbanda

Kotlin Multiplatform (KMP) is a code-sharing technology that allows us to use the same code for different platforms whether it’s JVM, Android, iOS, watchOS, tvOS, Web, Desktop, or WebAssembly. In this article, we will use Kotlin Multiplatform Mobile (KMM) which is a subset of KMP with the focus on providing better tooling and support for sharing code on mobile platforms i.e. Android and iOS.

By ProAndroidDev -
droidcon News

Tech Showcases,

Developer Resources &

Partners

/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/home-details/EmployerBrandingHeader
EmployerBrandingHeader
https://jobs.droidcon.com/
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/jobs-droidcon/jobs.droidcon.com
jobs.droidcon.com

Latest Android Jobs

http://www.kotlinweekly.net/
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/kotlin-weekly/Kotlin Weekly
Kotlin Weekly

Your weekly dose of Kotlin

https://proandroiddev.com/
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/pad/ProAndroidDev
ProAndroidDev

Android Tech Blogs, Case Studies and Step-by-Step Coding

/detail?content-id=/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Zalando/Zalando
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Zalando/Zalando
Zalando

Meet one of Berlin's top employers

/detail?content-id=/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Academy for App Success/Academy for App Success
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Academy for App Success/Academy for App Success
Academy for App Success

Google Play resources tailored for the global droidcon community

Follow us

Team droidcon

Get in touch with us

Write us an Email

 

 

Quicklinks

> Code of Conduct

> Terms and Conditions

> How to hold a conference

> FAQs

> Imprint

Droidcon is a registered trademark of Mobile Seasons GmbH Copyright © 2020. All rights reserved.

powered by Breakpoint One