Home / Insights / Mobile App Development

Mobile App Development

Android App Size and Startup Time: A Practical Plan with Baseline Profiles, R8 and Measurement

Slow cold starts and bloated downloads cost Android apps installs, ratings and retention. This guide explains how to measure startup properly, what Baseline Profiles and R8 actually do, and how to roll them out without breaking a release.

TopicsMobile App DevelopmentQA and Software Testing

Key takeaways

  • Measure before optimising: Android vitals flags cold starts of 5 seconds or more, warm starts of 2 seconds or more and hot starts of 1.5 seconds or more, all measured as time to initial display.
  • Baseline Profiles let ART compile critical code ahead of time at install, and Google reports execution speed improvements of about 30% from first launch; Startup Profiles on AGP 8.2+ add further gains through DEX layout.
  • R8 is the main lever for code size: shrinking, optimisation and obfuscation should be on for every release build, with full mode as the default since AGP 8.0 and keep rules written deliberately.
  • Most startup problems are self-inflicted: heavy Application.onCreate work, eager SDK initialisation and blocking I/O on the main thread. Profiles speed up code; they do not remove unnecessary work.
  • Treat size and startup as release gates with budgets, a Macrobenchmark suite on real devices and a mapping-file process for crash reports, not as a one-off clean-up.

Most Android teams know their app feels slower than it should on a mid-range phone, and that the download has crept up release by release. Fewer teams can say how slow, on which devices, or which change made it worse. That gap matters commercially. Google’s guidance on reducing app size states that a larger app can negatively affect install success and increase uninstalls, and its Android vitals startup documentation notes that slow starts can lead users to rate an app poorly or abandon it.

This article is for CTOs, product owners and engineering leads who own an Android app and want a plan rather than a list of tips. It covers how to measure startup and size, what Baseline Profiles and R8 actually change, how to decide what to do first, how to implement it safely in the build pipeline, and what it costs. It reflects how we approach performance work in our Android development engagements, where target devices, release management and maintenance are agreed explicitly at the start rather than discovered later.

Why startup time and app size deserve a budget

Startup time and download size are the first things every user experiences, and they degrade gradually: one more SDK, one more library, one more piece of configuration loaded at launch. No single change looks dangerous, so nobody owns the cumulative cost.

What Google measures

Android vitals in the Play Console reports startup using time to initial display (TTID), the time until the first frame of your UI is drawn. According to Google’s Android vitals launch-time page, it treats the following as excessive:

  • Cold start: 5 seconds or longer (process created from scratch).
  • Warm start: 2 seconds or longer (process may exist, activity recreated).
  • Hot start: 1.5 seconds or longer (activity brought back to the foreground).

These are thresholds for being flagged, not targets. An app that takes four seconds to show a usable screen on a common device is not in trouble with Play, but it is still losing people at the door.

What size limits apply

Google Play restricts the compressed download size of an Android App Bundle to 200 MB, with Play Feature Delivery and Play Asset Delivery available for larger apps, and signed APKs to 100 MB. Few business apps approach those limits; the real cost is that every extra megabyte is downloaded on every install, often on limited data plans.

Action

Write down two budgets now: a cold-start TTID target on a named reference device, and a maximum download size for your most common device configuration. Without budgets, performance work becomes an argument about opinions.

How to measure startup and size properly

Before changing anything, establish a baseline that is repeatable. Field data from Android vitals tells you whether there is a problem; lab measurement tells you why and whether a fix worked.

Two startup numbers, not one

Google’s app startup guidance distinguishes two metrics:

  • Time to initial display (TTID): the time to draw the first frame, including process creation on a cold start. The system reports it automatically as a Displayed line in Logcat, and adb shell am start -S -W reports it from the command line.
  • Time to full display (TTFD): the time until the app is actually usable, including content loaded asynchronously. The system cannot detect this on its own, so the app must call reportFullyDrawn(). In Jetpack Compose, ReportDrawnWhen and ReportDrawnAfter serve the same purpose.

TTID alone rewards a fast splash screen followed by a long spinner; if your first screen depends on a network call, TTFD is the number users feel.

Lab measurement with Macrobenchmark

The Jetpack Macrobenchmark library runs your release-like build on a physical device, starts it repeatedly from a cold state and reports timing distributions. It also generates Baseline Profiles, so setting it up pays twice. Include a mid-range device that resembles your user base.

Measuring size

Measure the download size Play reports per device configuration, not a universal APK, and break it down into DEX code, resources, native libraries and assets. Google’s size guidance notes that generated code from some protocol buffer tools can double or triple app size.

Step-by-step baseline

  1. Export the last 28 days of startup data from Android vitals, split by device and Android version.
  2. Add reportFullyDrawn() (or the Compose equivalents) to your main entry screens.
  3. Create a Macrobenchmark module with a cold-start test and one or two critical journeys.
  4. Record median and 90th percentile TTID and TTFD on two reference devices.
  5. Record download size for your top device configurations and a breakdown by component.

What Baseline Profiles, Startup Profiles and R8 actually change

These three tools are often discussed together, but they work at different stages and solve different problems. Mixing them up leads to unrealistic expectations.

Baseline Profiles: compile the right code at install

Without guidance, Android Runtime (ART) interprets app code at first, then JIT-compiles hot paths and writes optimised code in the background when the device is idle. Users therefore get a slower experience on first launch and after every update. Google’s Baseline Profiles overview explains that a Baseline Profile is a list of classes and methods used in critical journeys, shipped in the app as baseline.prof. Google Play delivers it, and ART compiles those methods ahead of time during installation. Google states that Baseline Profiles improve code execution speed by about 30% from the first launch.

Google Play also aggregates Cloud Profiles from real usage over time, but these take hours to days to reach devices and apply only to Android 9 (API 28) and higher. A Baseline Profile covers the first run, which is exactly when a new user forms an impression.

Startup Profiles: lay out DEX files for startup

Introduced with Android Gradle Plugin (AGP) 8.2, Startup Profiles are used at build time rather than install time. They tell R8 which code is needed during startup so it can be placed in the primary DEX file. Google reports that this adds roughly 15% to startup performance, more for large apps, and it requires a release build with R8 optimisation enabled. Google recommends using both profile types, with the Startup Profile generally a subset of the Baseline Profile.

R8: shrink, optimise and obfuscate

R8 is the compiler that turns your Java and Kotlin bytecode into DEX for release. According to Google’s shrink and optimise documentation, it removes unreachable code from your app and its libraries, applies optimisations such as method inlining and class merging, and shortens class, field and method names to reduce DEX size. With isShrinkResources enabled, the build also removes resources that are no longer referenced once unused code has gone. R8 full mode, which makes stricter assumptions about reflection to optimise more aggressively, has been the default since AGP 8.0.

ToolWhen it actsMain benefitMain risk
Baseline ProfileInstall time (AOT compilation on device)Faster startup and journeys from first launchProfile goes stale if journeys change and it is not regenerated
Startup ProfileBuild time (DEX layout by R8)Additional startup gain, especially for large appsNeeds R8 optimisation fully enabled on release
R8 code shrinking and optimisationBuild timeSmaller DEX, faster code pathsMissing keep rules break reflection-based code at runtime
Resource shrinkingBuild time, after code shrinkingSmaller downloadDynamically referenced resources removed by mistake
Lazy initialisation and App StartupRuntimeRemoves work from launch altogetherRequires code changes and careful testing

The last row matters most. Profiles make necessary code run faster. They cannot make unnecessary code free.

How to decide what to fix first

With a baseline in hand, prioritise by cost and expected gain. In our experience the order below suits most business apps, but your measurements should overrule it.

1. Remove work from the critical path

Google’s startup guidance lists the usual causes: heavy work in Application.onCreate or global singletons, disk I/O and deserialisation on the main thread, deep or heavy first-screen layouts, and legacy splash activities. Third-party SDKs initialised eagerly through content providers are a frequent offender. The recommended fixes are lazy initialisation, dependency injection, the Jetpack App Startup library and deferring non-critical UI.

For example, an illustrative field-service app might initialise analytics, crash reporting, a feature-flag client, a mapping SDK and a local database migration before showing anything. Only crash reporting and the database are truly needed before the first screen; the rest can wait until after first frame or until the user opens the relevant feature.

2. Turn on R8 properly

Many older projects still ship with isMinifyEnabled = false on release because someone once hit a crash and switched it off. Turning it back on is usually the largest single size reduction available, but it needs testing effort (see the implementation section).

3. Add Baseline and Startup Profiles

Once the startup path is lean and R8 is enabled, profiles are relatively cheap to add and maintain, because the Macrobenchmark module already exists.

4. Tackle size by component

Then work through the size breakdown: remove unused libraries, restrict resource configurations to the languages you support, convert large images to WebP or vectors where suitable, and strip debug symbols from native libraries.

A quick diagnostic rule: if only the first launch after install or update is slow, ART has not yet compiled your code and a Baseline Profile is the fix; if every cold start is slow, the problem is work on the startup path; if the first frame is fast but useful content is slow, look at network and database calls blocking the first screen.

How to implement it safely in your build pipeline

The steps are well documented; the risk is releasing them without enough testing.

Enabling R8 without breaking production

  1. Set isMinifyEnabled = true and isShrinkResources = true on the release build type, using proguard-android-optimize.txt as the default rules file.
  2. Audit code and libraries that use reflection, serialisation by field name, JNI or dynamic resource lookups. These are where full mode’s stricter assumptions can remove or rename something needed at runtime. Add targeted keep rules rather than broad -keep class com.example.** rules that undo most of the benefit.
  3. Run the full regression suite against the minified release build, not a debug build. Pay particular attention to JSON parsing, deep links, push notification handling and any feature behind a remote flag.
  4. Archive the R8 mapping file for every release and upload it to Play Console and your crash reporting tool, so obfuscated stack traces can be retraced.
  5. Roll out through Play’s staged rollout and watch crash rates before going to 100%.

Generating and maintaining profiles

Google’s Baseline Profiles documentation recommends the Baseline Profile Gradle plugin, which handles variant configuration automatically. The profile is generated from a non-obfuscated build, and on AGP 8.2 and later R8 rewrites the rules to match the obfuscated release. The profile generator is a Macrobenchmark test that starts the app and walks through critical journeys such as login, the main list and checkout.

  • Cover startup, common navigation and scrolling, and revenue-critical flows; do not try to cover every screen.
  • Regenerate the profile whenever those journeys change materially, ideally as a scheduled CI job.
  • Keep the compiled profile under the 1.5 MB on-device limit Google documents.
  • Test through Play’s internal testing track: Google notes that internal app sharing does not support Baseline Profiles, and other distribution channels may not apply them at install.

Making it stick

Add a startup benchmark and a size check to CI and fail or flag the build when a budget is exceeded. A simple rule, such as no merge that increases download size by more than an agreed amount without a written reason, prevents most regressions. If you are already investing in mobile engagement, as discussed in our article on keeping fitness app users engaged after the first month, a slow launch undermines that work every single day.

Risks, costs and trade-offs

None of this is free, and decision-makers should know where the effort goes.

Engineering effort

The costs fall into four buckets: setting up measurement (Macrobenchmark module, reference devices, CI integration), refactoring startup code, enabling and testing R8, and maintaining profiles. The first and third are mostly one-off. Startup refactoring varies widely with how much the app does at launch. Profile maintenance is small if automated and quietly degrades if not.

Release risk

The most common failure is enabling R8 full mode and missing a reflection path that only runs in production, such as a rarely used deep link or a serialisation model added by another team. This is why minified builds must be what QA tests and why staged rollouts matter.

On-device processing trade-offs

Apps that bundle on-device machine learning models or large assets face a direct tension between capability and size. Our article on pose estimation and privacy in fitness apps discusses one such case. Play Asset Delivery or downloading models after install can keep the initial download small, at the cost of extra complexity and a first-use delay.

A checklist for your next release cycle

Use this as the definition of done for an Android performance pass.

Measurement

  • Cold-start TTID and TTFD budgets agreed on a named reference device.
  • reportFullyDrawn() or Compose equivalents in place on entry screens.
  • Android vitals startup data reviewed by device and OS version.
  • Macrobenchmark module running cold-start and critical-journey tests on a physical device.
  • Download size per top device configuration recorded and tracked.

Startup path

  • No disk or network I/O on the main thread before first frame.
  • Non-essential SDKs initialised lazily or after first frame.
  • Legacy splash activity replaced with the SplashScreen API.
  • First screen layout flattened and heavy composables deferred.

Build and release

  • R8 code and resource shrinking enabled on release with targeted keep rules.
  • QA regression run on the minified release build.
  • Mapping files archived and uploaded for every release.
  • Baseline Profile and, on AGP 8.2+, Startup Profile generated via the Gradle plugin and regenerated in CI.
  • Staged rollout with crash and startup monitoring before full release.

If you want a second opinion on where your app’s startup time is going, start by sharing your Android vitals data and a release build; the first diagnosis is usually quick and tells you whether you need a short fix or a longer refactor.

Frequently asked questions

Will Baseline Profiles help if our app is distributed outside Google Play?

Partly. Google notes that other distribution channels may not apply the profile at install, so the benefit may arrive only after background optimisation, typically when the device is idle overnight. The Profile Installer library helps, but Play distribution gives the most predictable result.

Is it safe to enable R8 full mode on an older codebase?

Yes, with testing. Full mode has been the default since AGP 8.0, but it makes stricter assumptions about reflection. Audit serialisation, JNI and reflection-based libraries, add targeted keep rules, run your regression suite on the minified build and use a staged rollout.

How often do we need to regenerate Baseline Profiles?

Whenever critical journeys change materially, such as a redesigned home screen or a new login flow. The simplest approach is a scheduled CI job that regenerates the profile and opens a change for review.

What startup time should we target?

Android vitals flags cold starts of 5 seconds or more, but that is a warning line, not a goal. Set a target based on your users’ typical devices and competitors, measure both time to initial display and time to full display, and track the 90th percentile as well as the median.

Does reducing app size really affect installs?

Google’s own size guidance says larger apps can reduce install success and increase uninstalls, particularly where networks are slow or data is limited. The effect varies by market, so check your Play Console acquisition data by country and device.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. Android Developers: Baseline Profiles overview — accessed 9 November 2026. How Baseline and Startup Profiles work, the reported ~30% and ~15% gains, AGP 8.2 features, Cloud Profiles and known limitations.
  2. Android Developers: App startup time in Android vitals — accessed 9 November 2026. Thresholds for excessive cold (5 s), warm (2 s) and hot (1.5 s) starts, measured as TTID.
  3. Android Developers: App startup time — accessed 9 November 2026. Definitions of cold, warm and hot starts, TTID and TTFD, reportFullyDrawn and common causes of slow startup.
  4. Android Developers: Shrink, obfuscate and optimise your app — accessed 9 November 2026. What R8 does, recommended release settings, full mode default since AGP 8.0 and reflection risks.
  5. Android Developers: Reduce your app size — accessed 9 November 2026. Effect of size on installs and uninstalls, 200 MB bundle and 100 MB APK limits, and common sources of bloat.

Is your Android app slower to start than it should be?

Share your Android vitals data and a release build, and our Android engineers will tell you where startup time and download size are going and what to fix first.