Android Cold Start, Warm Start and Hot Start states in simple words?
Introduction
Every mobile app user expects the apps they use to be responsive and fast. When an app has a slow start time, it fails to meet the user’s expectations, potentially leading to poor ratings in the app store. In this article, we will delve into the concept of app startup time and explore ways to optimize your app’s launch performance.
Understanding App Startup Time
To understand app startup time, we must recognize that an app can be launched in three distinct states: Cold Start, Warm Start, and Hot Start. These states determine how long it takes for your app to become visible to the user. In brief, a cold start means the app begins from scratch, while the other two states bring a running app from the background to the foreground.
Android Developers recommend optimizing based on the assumption of a cold start, as this can improve the performance of warm and hot starts as well.
Key Metrics for Determining App Startup
- Time to Initial Display (TTID): This represents the time taken to display the first frame of the app. In other words, TTID informs the user that the app is loading.
- Time to Fully Drawn (TTFD): This signifies the time taken for the app to become fully interactive. TTFD informs the user when the app is actually usable.
So if either of these is taking too long user might kill the app before it even fully loads.🥹
To get accurate values for TTFD, signal when the app reaches a fully drawn state to help ensure accurate times are measured. To learn how to do this, see Improving startup timing accuracy.
Illustrating App Startup Types
Let’s use a coffee-making analogy to understand the three app startup types:
What is Cold Start?
Imagine making coffee from scratch. You have to grind the beans, brew the coffee, and it takes some time. In the app world, a cold start is slower because your app wasn’t running in the background. So when you open it, it takes more time to set up everything. Now the app is starting from scratch, it happens when your app is launching for the first time after a device booted or since the system killed the app.
At the beginning of a cold start…
Get Tharindu Welagedara’s stories in your inbox
Join Medium for free to get updates from this writer.
System has to do following three tasks first:
- Load and launch the app
- Display a blank starting window for the app immediately after launch.
- Create the app process.
As soon as system create the process. App process should do next stages:
- Create the app object
- Launch main thread (UI Thread)
- Create main activity
- Inflate views
- Layout the screen
- Perform the initial draw
See below visual representation to understand this clearly.
What is Warm Start?
This is like reheating yesterday’s coffee. It’s faster than making it from scratch but not as quick as pouring from the thermal carafe. In the app world, a warm start means your app is partially ready. It’s not as fast as a hot start, but it’s quicker than a cold start because some parts are already prepared. It’s like your app was paused and now needs a little warming up to be fully ready. In other words warm start is subset of operations that take place in cold start. Ex:
- The app process is already running in the background but the app must recreate the activity from scratch using a call to
onCreate(). - Suppose if the system remove your app from the memory and then the user re-launches it. Then the process and activity needs to be recreated, but the task can benefit from the saved instance state and other optimizations Android does for you.
What is Hot Start?
This is like having your coffee ready in a thermal carafe, all warm and good to go. You just pour it, and it’s quick because you didn’t need to brew it or heat it up. In the app world, a hot start means your app is already running in the background, so when you open it, it appears quickly because it’s ready.
Likewise, the system just brings your activity to the foreground. If all of your app’s activities are still in memory, then the app can avoid repeating object initialization, layout inflation, and rendering.
Android Vitals
Android vitals define excessive startup times for your app as follows:
- Cold Startup: 5 seconds or longer.
- Warm Startup: 2 seconds or longer.
- Hot Startup: 1.5 seconds or longer.
Exceeding these thresholds can negatively impact the user experience, making it essential to optimize your app’s performance to provide a smoother user experience.
Conclusion
In conclusion, understanding the distinctions between Cold Start, Warm Start, and Hot Start is crucial for app developers. Optimizing app startup time is vital to enhance responsiveness and speed, resulting in more satisfied users. By following best practices and reducing startup times, your app can meet user expectations and thrive in the competitive mobile app market.









