Mosmoxmosmox

Mosmox journal

In focus — Android.

A selection of publications grouped under the Android tag.

How to Reduce Battery Consumption in a Mobile App

How to Reduce Battery Consumption in a Mobile App

Users judge an app not only by its features but by how much of the device it consumes. Excessive location use, background requests, frequent syncs and heavy animations shorten battery life and erode trust. And when the system lists an app near the top of battery consumers, the decision to uninstall comes quickly.

Energy use is hard to notice during development: the phone on the desk is plugged in and sessions are short. That is why in our projects we measure it deliberately, with a defined scenario and on real devices. Below is where costs usually hide, what thresholds Google Play sets and how to build a process so energy efficiency does not depend on random complaints.

Why this is now a Google Play visibility issue

Android vitals lists excessive partial wake locks among its core quality metrics, alongside crash rate and ANR. Partial wake lock use is considered excessive when all of an app's partial wake locks together run for two or more hours in a 24-hour period, counting only time in the background or while a foreground service is running. If this happens in more than 5% of sessions over 28 days, Google Play may reduce the app's visibility.

Vitals exempts some scenarios where the user benefit is clear and there is no alternative: audio playback, location and user-initiated JobScheduler jobs. All other background activity needs a justification.

Android vitals metricWhat it measuresTypical cause
Excessive partial wake locksTotal background wake lock time of 2+ hours per dayA forgotten release, custom background logic instead of WorkManager
Stuck partial wake locksA single wake lock held for a long timeAn exception-handling bug, a wake lock with no timeout
Excessive wakeupsFrequent device wakeups from alarmsExact AlarmManager alarms for tasks that do not need precision
Excessive background Wi-Fi scansNetwork scanning in the backgroundDevice discovery or location lookups without need
Excessive background network usageMobile data used in the backgroundServer polling, unbounded prefetching

Where to look for costs

  • Background work without a clear need. Syncing every few minutes when data changes once a day.
  • Polling instead of events. Push messages or batched sync are almost always cheaper than regular polling.
  • Sensors left active. GPS, camera or Bluetooth scanning after the screen is closed.
  • Wrong location accuracy. High accuracy where city- or district-level would do.
  • Off-screen animations and video. A Lottie animation or autoplay in a hidden tab keeps loading the GPU.
  • Third-party SDKs. Analytics and ads may run their own background jobs the team does not know about; we described how to audit dependencies in our article on unnecessary third-party libraries.

How to measure energy use

  1. Record a baseline scenario. Device model, OS version, network type, brightness, usage duration and background conditions. Without this, two measurements cannot be compared.
  2. Choose tools. On Android, the Power Profiler in Android Studio on devices that support energy measurement, Background Task Inspector for WorkManager and Perfetto system traces. On iOS, the Energy Organizer and energy reports in Xcode, plus MetricKit for production data.
  3. Profile a concrete journey. For example, 30 minutes of navigation, an hour in the background after an order or an overnight idle period. A generic "one-day test" yields little useful information.
  4. Check background mode separately. Lock the screen and see what the app does over the next few hours: wake locks, network requests, alarms.
  5. Confirm the optimisation did not break freshness. Less frequent sync must not lead to stale statuses in key journeys.
  6. Compare releases with the same method. An energy budget is only useful when it is checked regularly.

What usually has the biggest effect

  • Moving background work to WorkManager with network and battery constraints; the minimum interval for a periodic job there is 15 minutes, which is enough for most scenarios.
  • Replacing polling with push messages that wake the app only when there is new data.
  • Batching network requests so the radio switches to its active state less often.
  • Choosing the minimum sufficient location accuracy and turning it off when the result is not visible to the user.
  • Stopping animations, video and sensors in lifecycle callbacks when the screen is inactive.
  • Local caching that reduces repeated downloads; its limits are covered in our article on caching.

On iOS the system restricts background work more strictly, but that does not take responsibility away from the team. For tracking movement that does not need high accuracy, the significant-change location service is a better fit than continuous GPS. The system runs background refresh via BGTaskScheduler at its own discretion, so critical logic should not depend on it. And in Low Power Mode, which an app can detect through ProcessInfo, it makes sense to automatically reduce update frequency and turn off video autoplay and decorative animations.

Transparency for users

People should understand why a permission or background activity is needed. Navigation during a trip is obvious. An app reading location with no visible outcome looks like a risk to both privacy and battery. Explain the purpose before the system prompt, offer a choice of update frequency and show when background work is active, for example with an ongoing notification while tracking a delivery.

Common mistakes

  • A wake lock with no timeout that is never released after an exception.
  • Exact alarms for tasks that do not need minute-level precision.
  • Using a foreground service to "work around" background restrictions.
  • Testing only while charging and on stable Wi-Fi.
  • No post-release monitoring: problems are found through reviews rather than metrics.

Energy efficiency checklist

  • Every background task has an owner, a justification and constraints.
  • No wake locks without timeouts; wake lock and wakeup vitals are below thresholds.
  • Polling has been replaced with push or batched sync.
  • Location accuracy matches the task, and sensors turn off when the screen is not active.
  • The energy scenario is checked on real devices before every major release.
  • Users can see why background activity is needed and can control it.

Sources: Android Developers: Android vitals; Android Developers: Excessive partial wake locks; Android Developers: WorkManager; Android Developers: App quality and user experience; Apple: MetricKit.

Android Apps from Google AI Studio and Firebase: From Prototype to Google Play Release

Android Apps from Google AI Studio and Firebase: From Prototype to Google Play Release

On November 17, 2026 Firebase announced that Google AI Studio now generates full Kotlin Android apps with a backend: a database, Google sign-in and Gemini-powered AI features. You describe the idea in a prompt and the agent sets up the rest. For a founder this means a working prototype in an evening. But there is still a lot of work between "it works in the demo" and "it is ready for Google Play". Here is what the integration does and what to check before release.

Facts about the integration come from the Firebase blog post.

What the AI Studio agent does

When you ask for an Android app, the agent detects from your prompt whether you need AI features, data storage and user sign-in. With your approval it:

  • creates a Firebase project, provisions Firestore, enables Firebase Authentication and connects the app code to them;
  • configures Google Sign-In;
  • adds AI features through Firebase AI Logic (Gemini API calls) with App Check enforced automatically.

According to Firebase, you do not need to install anything, write code, configure libraries by hand or even enter a credit card.

What changed from the previous version

Before, Kotlin apps from AI Studio kept data only in the browser session: close the tab or switch devices and the data was gone, and collaborative features were impossible without a cloud database. Now data lives in Firestore protected by Firebase Security Rules, so a user can start on a tablet and continue on a phone. Firestore also works offline and syncs once the network is back. The agent writes and validates Security Rules together with the authentication setup.

Why App Check matters here

If an app calls Gemini directly, the key and quota are easy to steal. Firebase AI Logic keeps credentials on the server, and App Check verifies that requests come from your genuine app on an untampered device. Enabling it by default is the right call: an unprotected AI endpoint can burn through a budget in days.

Where the prototype ends

The generated app covers the technical start: project, database, sign-in, AI. A release depends on things the prompt does not know about. Here is the checklist we recommend before publishing.

1. Data security

  • Read the Security Rules like an attacker: can a user read or change someone else's documents if they know the ID?
  • Check that App Check is enforced for every service and that debug tokens are not in the release build.
  • Make sure there are no secrets in the code and that AI requests go only through AI Logic.

2. Money and limits

  • Starting without a card does not mean running for free. Before launch decide which plan Firestore and Gemini will run on, and set up budget alerts in Google Cloud.
  • Estimate the cost of one active user: how many Firestore reads and Gemini tokens a typical flow uses.
  • Add per-user rate limits for AI requests so one account cannot drain the quota.

3. Google Play requirements

  • A privacy policy and an accurate Data safety form: the app collects a Google account, stores data in Firestore and sends content to Gemini.
  • If users can create an account, Google Play requires a way to delete it, both in the app and through a web link.
  • Generative AI apps fall under separate Google Play rules on AI-generated content and letting users report it.

4. Code quality and maintenance

  • Generated code needs a review and an architecture the team can grow: separated UI, logic and data, error handling and offline states.
  • Add analytics, Crashlytics and at least basic tests for key flows.
  • Make sure the code is in your repository and the Firebase project is in your Google Cloud organization with more than one person having access.

5. Product

  • AI answers can be wrong: decide how the app shows uncertainty, lets users regenerate a result and what they see when Gemini is unavailable.
  • Check the first-run experience: Google sign-in, empty states, onboarding.

Who benefits

Founders can test an idea with real users before investing in development. Product managers can show the team a live prototype instead of a mockup. Developers get a fast scaffold with Firebase services already connected, which they then bring up to production quality.

Conclusion

AI Studio with Firebase removes the dullest stage: setting up the backend, sign-in and secure access to Gemini. It really does shorten the path from idea to prototype. A Google Play release, though, needs what a prompt cannot solve: verified access rules, cost control, policy compliance and maintainable code. Plan that stage from day one and the prototype becomes a product rather than a demo you will have to rewrite.

How to Reduce Mobile App Size Without Losing Functionality

How to Reduce Mobile App Size Without Losing Functionality

App size affects the decision to install, download time and how much storage a product takes on the device. It matters especially in markets with expensive mobile data and on phones with 32–64 GB of storage, where people regularly delete apps to make room for photos and system updates.

The good news is that most "extra" megabytes have nothing to do with functionality. They are forgotten resources, unoptimised images, duplicate libraries and code nobody calls. Below is how we at the studio approach size reduction: what to measure, where to look for weight, which tools give the biggest effect, and what you should not cut even for a nicer number.

Why size matters for the business

In 2017 the Google Play team published an analysis of its own data: for apps under 100 MB, every additional 6 MB of APK size correlated with roughly a 1% drop in install conversion. In emerging markets, removing 10 MB correlated with about a 2.5% increase in conversion. This is a correlation, not a controlled experiment, and some teams report a much smaller effect, but the direction is clear: a large package is friction at the door.

Size does not only affect the first install. Large updates are more often postponed when the phone is not on Wi-Fi, and a heavy app is the first candidate for deletion when the system warns about low storage. In our projects we treat size as part of the experience, alongside startup speed.

Where the extra weight comes from

  • unused resources and duplicate icons and illustrations in several densities;
  • large images and video without adaptive variants or modern formats;
  • third-party SDKs that add unused features;
  • debug code, logging and symbols in production builds;
  • dependencies that transitively pull in unnecessary modules;
  • bundled fonts with full glyph sets for languages the product does not support;
  • native libraries for every architecture in a single package.

Analyse first, optimise second

Start with a build analysis rather than assumptions. On Android that means APK Analyzer in Android Studio, the size report in Play Console and comparing two builds side by side. On iOS, use the App Thinning Size Report in Xcode and the per-device file size report in App Store Connect. Look at download size and install size separately: the compressed package and what occupies disk space can differ several times over.

Source of weightHow to find itWhat usually helps
Code (DEX, binary)APK Analyzer, Link Map in XcodeR8 with shrinking and optimisation, dead code removal, SDK audit
Raster imagesSort resources by sizeWebP or AVIF, vector graphics for icons, Asset Catalog
Unused resourcesLint, shrinkResourcesAutomatic removal at build time, cleaning up obsolete screens
Native librariesContents of the lib folderAndroid App Bundle, which delivers only the required architecture
Large contentVideo, models, dictionaries in the packagePlay Asset Delivery, On-Demand Resources or Background Assets on iOS

According to the WebP documentation, lossy compression produces files 25–34% smaller than comparable JPEGs, and lossless compression about 26% smaller than PNG. In illustration-heavy projects, images are often the fastest win.

A step-by-step size reduction plan

  1. Capture a baseline. Record download and install size for a typical device on each platform and keep the report in the repository.
  2. Find the ten largest components. A handful of items usually account for most of the weight, so start there.
  3. Turn on platform tooling. On Android, R8 with minifyEnabled and shrinkResources, and publishing as an App Bundle. On iOS, Asset Catalogs and no unnecessary architectures or symbols in the final binary.
  4. Review media. Convert raster assets to modern formats, replace simple icons with vectors and remove duplicates.
  5. Audit dependencies. For every SDK, check whether the whole module is used and whether a lighter alternative exists.
  6. Move rare scenarios out. Features used by a small share of the audience can be delivered as a separate module via Play Feature Delivery, or their content can be downloaded after installation.
  7. Add a budget to CI. A build that grows beyond an agreed threshold, for example 500 KB in a single pull request, should require explicit approval.

What not to cut

Do not remove analytics, security or error handling just to improve a number. Decide what must be available immediately and what can load later. Users care about a fast, useful start, not the smallest possible first package.

Be equally careful with aggressive obfuscation and removing code that is called via reflection: incorrect R8 rules produce crashes that only appear in release builds. That is why we verify every optimisation with tests and on real devices.

Note a newer Google requirement as well: Android vitals now tracks DEX code optimisation. Apps with more than 10 MB of DEX code are expected to apply optimisation, obfuscation and shrinking, and failing the thresholds may affect visibility on Google Play starting in February 2027.

Common mistakes

  • Optimising without measuring. The team spends a week rewriting a module and saves a few hundred kilobytes.
  • Comparing different metrics. APK size on a developer's disk is not what the user downloads through an App Bundle.
  • Moving everything to "download later". If a core feature needs an extra download after first launch, the user sees a spinner instead of value.
  • A smaller file but a slower start. If unpacking or initialisation became heavier, the overall experience got worse.
  • A one-off clean-up. Without a budget, size creeps back within a few releases.

Check results on real devices, especially budget ones; we wrote about this in detail in our article on testing on inexpensive phones. Our breakdown of Baseline Profiles in Android Calendar shows how code optimisation and startup are connected.

A one-sprint action plan

  • Produce download and install size reports for iOS and Android.
  • List the ten largest components and an owner for each.
  • Enable R8, shrinkResources and App Bundle publishing if they are not already on.
  • Convert the largest raster assets and remove duplicates.
  • Remove or replace SDKs that deliver no measurable value.
  • Add a size check to CI with a per-pull-request threshold.
  • After release, compare install conversion, first-launch time, crash rate and uninstalls.

Sources: Google Play: Shrinking APKs, growing installs; Android Developers: Reduce your app size; Android Developers: Android vitals; Google: WebP; Apple: Reducing your app’s size.

Secrets in Mobile Apps: Keychain, Android Keystore and What Never Belongs in the Build

Secrets in Mobile Apps: Keychain, Android Keystore and What Never Belongs in the Build

Every mobile build is a file you voluntarily hand out to millions of people. An IPA or APK can be unpacked, its strings extracted in a minute, and its traffic inspected through a proxy on your own device. So the core security rule is blunt: treat everything in the build as public. Obfuscation makes analysis harder, but it does not turn a key into a secret.

At the same time, the app needs somewhere to keep session tokens, local encryption keys and user credentials. That is what the system stores are for: Keychain on iOS and Android Keystore. This article covers what may and may not go into code, how to use the system stores correctly and how to design an architecture in which real secrets never reach the device at all.

Why "hiding the key in code" does not work

It is no accident that first place in the OWASP Mobile Top 10 (2024) goes to M1: Improper Credential Usage, which includes keys hardcoded into the app. Here are the usual ways secrets get "hidden" and why they fail:

Hiding methodHow it is bypassedTime for an experienced analyst
String in code or Info.plist / strings.xmlUnpack the archive and search stringsMinutes
BuildConfig, .xcconfig, build variablesThe same values end up in the binaryMinutes
Base64 or XORDecode once the routine is foundMinutes to hours
Native library (NDK, C)Disassembler, or hooking the call on a rooted deviceHours
Fetching the key from a server at launchIntercepting traffic or process memoryHours

The time estimates come from our practical penetration-testing experience, not a formal metric. The point is that each approach raises the cost of an attack without changing the model: a key the app uses is available to whoever controls the device.

What may and may not ship in the build

Value typeIn the build?Condition or alternative
Firebase config (apiKey, projectId)YesIdentifiers, not secrets; access is enforced by Security Rules and App Check
Google Maps / Places SDK keyYes, restrictedRestrict by package name + SHA-1 / bundle ID and by API list
Public key for pinning or signature checksYesPublic by definition
Payment provider publishable keyYesOnly for client-side operations the provider intends
Payment provider secret keyNoBackend only
Cloud keys (AWS, GCP service account)NoBackend, or temporary least-privilege credentials
LLM / AI API keysNoProxy through the backend with authentication and limits
OAuth client secretNoPKCE for a public client, backend exchange if needed
JWT signing key, admin tokens, DB passwordsNo, neverServer only, in a secrets manager

Firebase states plainly in its documentation that Firebase API keys are not secrets and can be included in code, with protection provided by security rules. For Google Maps keys, Google recommends application and API restrictions and separate keys per platform.

A word on AI keys. An LLM API key inside an app is a direct route to a bill of thousands of dollars: it will be extracted and used for someone else's requests. Always proxy such calls through your backend, tied to a user, with limits and monitoring.

An architecture with no secrets on the device

The right question is not "how do I hide the key" but "how do I make the client not need it".

  1. The backend as intermediary. The app authenticates the user, gets their token and calls your API. Your server calls third-party services with its own secrets.
  2. Short-lived credentials. If the client needs direct access (say, uploading a file to object storage), the backend issues a signed URL or a token valid for minutes with minimal permissions.
  3. App integrity checks. App Attest on iOS and the Play Integrity API on Android let the server confirm a request comes from a genuine, unmodified copy of the app on a real device. That is not a secret in the build but a cryptographic attestation from the platform.
  4. Limits and monitoring. Even "public" keys deserve quotas and alerts on unusual usage.

iOS: Keychain and the Secure Enclave

Keychain Services is the system's encrypted store for small secrets: tokens, passwords, keys. Data is encrypted with hardware-protected keys and accessible only to your app (or an app group via Keychain Sharing).

The accessibility class is the key setting

The kSecAttrAccessible attribute determines when an item can be read (Apple documentation):

  • WhenUnlocked: only while the device is unlocked. Right for most data used on screen.
  • AfterFirstUnlock: after the first unlock since reboot. Needed if the token is used in the background (background refresh, push handling).
  • WhenPasscodeSetThisDeviceOnly: only if a passcode is set; the item is deleted if the passcode is removed.
  • The ThisDeviceOnly suffix keeps the item out of backups restored to other devices. For session tokens this is usually the right choice.

For sensitive actions, add access control with biometrics (SecAccessControl with .biometryCurrentSet): the item then cannot be read without Face ID or Touch ID, and access is invalidated when biometric enrolment changes.

For keys that must never leave the device, use the Secure Enclave: the private key is generated inside the coprocessor and cannot be exported; the app only asks it to sign or decrypt. The limitation: the Secure Enclave supports P-256 elliptic curve keys.

An often forgotten nuance: in practice Keychain items can survive app deletion. If users are unexpectedly signed in after reinstalling, clear the Keychain on first launch, keyed off a flag in UserDefaults.

Android: Keystore and data encryption

The Android Keystore stores cryptographic keys so their material never enters the app process: encryption and signing are performed by the system, on most modern devices in a hardware environment (TEE), and on devices with StrongBox (Android 9+) in a separate secure chip.

A typical scheme for tokens

  1. Create an AES key in the Keystore via KeyGenParameterSpec for encryption and decryption, in GCM mode.
  2. Encrypt the token with that key and store the ciphertext in DataStore or a file.
  3. For sensitive operations enable setUserAuthenticationRequired so the key works only after biometrics or a PIN (via BiometricPrompt with a CryptoObject).
  4. Where available, request StrongBox (setIsStrongBoxBacked) and provide a fallback when it is not.

An important change: Google deprecated the Jetpack Security library (EncryptedSharedPreferences, MasterKey) in 2025 in favour of platform APIs and direct use of the Keystore. Do not rely on it in new projects, and plan a migration in existing ones.

Backups

Keystore keys are not backed up, but data encrypted with them can be. After a restore on a new device, the app gets ciphertext without a key. Exclude such files via dataExtractionRules / fullBackupContent (Auto Backup) and handle decryption failures gracefully: clear the data and ask the user to sign in again.

Secrets in the repository and CI

Many leaks come not from the build but from git: a key committed "temporarily" stays in history forever.

  • Enable secret scanning: GitHub secret scanning with push protection, or gitleaks in pre-commit hooks and CI.
  • Keep environment configuration out of the repository; in CI, use encrypted variables or a secrets manager.
  • Store signing keys (the Android keystore, iOS certificates) separately, with restricted access and a backup. A lost Android upload key can be recovered through Play App Signing, but it is a support procedure.
  • If a secret reaches the repository, rotate it. Rewriting history does not help if someone already cloned it.

Common mistakes

  • Tokens in UserDefaults or plain SharedPreferences.
  • A payment or AI provider secret key in app code "because it is faster for the MVP".
  • Logging the Authorization header or token-bearing responses in release builds; tokens in crash reports and analytics.
  • The deprecated "Always" Keychain accessibility class, or AfterFirstUnlock with no background need.
  • No handling for a Keystore key becoming invalid (screen lock changed, new biometrics enrolled).
  • Google Maps keys without application restrictions.
  • Relying on obfuscation to protect secrets.

Secrets audit checklist

  1. Unpack your own release build and search for strings such as key, secret, token, sk_, AKIA.
  2. Build a register of every key in the build: purpose, whether it is a secret, which restrictions apply.
  3. Move every real secret to the backend; restrict client keys by application and quota.
  4. Tokens only in the Keychain (ThisDeviceOnly) or encrypted with a Keystore key.
  5. Add App Attest / Play Integrity for critical endpoints.
  6. Check logs, crash reports and analytics for tokens and personal data.
  7. Set up secret scanning in the repository and CI; rotate anything that ever landed there.
  8. Compare the implementation against the MASVS-STORAGE and MASVS-CRYPTO groups of OWASP MASVS.

Which tokens the app receives and how to refresh them is covered in our article on OAuth 2.0 + PKCE.

Sources: OWASP Mobile Top 10 (2024); OWASP MASVS; Apple: Keychain Services; Apple: Restricting keychain item accessibility; Apple: Protecting keys with the Secure Enclave; Android Keystore system; AndroidX Security release notes; Android Auto Backup; Firebase: API keys; Google Maps Platform: API security best practices; Apple: App Attest; Play Integrity API; GitHub: Secret scanning.

Josh: How Faster Startup Helped Retain Users on Older Devices

Josh: How Faster Startup Helped Retain Users on Older Devices

A video app can lose attention in seconds. If the feed takes too long to open or scrolling stutters, it is easier for users to close the app and move to another service. The problem is even sharper for audiences on older and low-end phones: every extra hundred milliseconds at startup is multiplied by a slow CPU, limited RAM and crowded storage.

The case study of Josh, an Indian short-video platform, published on Android Developers, shows how systematic startup work turns into a product result. Below we break down what the team actually did, which lessons are worth carrying into your own project, and how we at the studio organise this kind of optimisation, from the first trace to post-release monitoring.

What we know about the Josh case

Josh is a short-video app launched in August 2020. When the case study was published, it had more than 124 million monthly active users and around 60 million daily users. Its audience used a very wide range of devices, from flagships to inexpensive models, and video was the main format. Any stutter in the feed or pause in an interaction quickly made people lose interest.

The team monitored Android vitals and identified an opportunity to improve startup. They prioritised cold start, the heaviest scenario, when the app process does not exist yet. The reasoning is simple: speed up cold start and warm and hot starts usually improve as well.

According to the case study, average startup time improved by 30%, and the app became three times faster for roughly 10% of users on older and low-end phones. Better bounce rates and retention helped Josh retain more than 1 million users compared with the baseline, and Play Store ratings trended upward after the release.

What exactly changed in startup

The most valuable part of the case is not the percentages but the list of actions. The team used custom traces, Systrace, Perfetto, dumpsys and Android Studio Profiler, and found that most of the time was spent in Application.onCreate and other synchronous methods at startup.

  • They profiled every block of code executed during startup.
  • They investigated the impact of third-party SDKs and disabled auto-initialisation for some of them.
  • They removed legacy libraries.
  • They deferred some modules and moved them to background execution.
  • They reduced the size of splash screen drawables and optimised them for different screen sizes.

Each change was validated in isolation by emulating cold starts and using the Jetpack Macrobenchmark library. That detail matters: without isolated measurement you cannot tell which change produced the effect and which only added complexity.

Why the average hides the problem

Average startup time is a convenient number for a report, but it masks the worst experience. If 90% of the audience opens the app in one second and 10% in five, the average looks acceptable even though the product is effectively broken for one user in ten. That is why the Josh result of "three times faster for 10% of users" matters more than "30% on average": it shows the team worked on the tail of the distribution.

In our projects we see the same pattern: p90 and p95 percentiles split by device class almost always reveal problems that are invisible in the average. Android vitals defines the reference points directly.

Startup typeWhat happens"Slow" threshold in Android vitals
ColdThe process is created from scratch; Application and the first Activity are initialised5 s or more
WarmThe process exists, but the Activity is recreated2 s or more
HotThe Activity returns from the background1.5 s or more

These thresholds mark where the experience is considered bad; they are not a goal. For our own budgets we usually set much stricter p90 values on low-end devices and track time to the first rendered frame of the feed separately.

How to repeat the approach in your app

  1. Capture a baseline. Record cold, warm and hot start on three device classes: a flagship, a mid-range phone and a three- to four-year-old budget phone. Use Macrobenchmark with several iterations rather than a single manual launch.
  2. Take a system trace. In Perfetto, look at what happens between process creation and the first frame: SDK initialisation, dependency injection, disk reads, network calls on the main thread.
  3. Build an initialisation register. For every SDK and module, record whether it is needed before the first screen, who owns it and how many milliseconds it takes.
  4. Defer everything non-critical. Initialise analytics, ads and features that appear later lazily or on a background thread after the first frame.
  5. Lighten the first screen. Shrink splash graphics, simplify the layout and load only the first feed items rather than the whole feed.
  6. Measure every change separately. One pull request, one optimisation, one measurement. That way you know the real contribution of each step.
  7. Lock in the result. Add Macrobenchmark to CI with a startup budget that blocks a release when exceeded. Also consider Baseline Profiles, a tool that helps critical code run faster from the very first launch.

Typical mistakes that eat the gains

  • Testing only on the team's phones. Developers usually have new devices and simply do not see problems in the budget segment.
  • Measuring debug builds. A debug build behaves differently from a release build with R8 and optimisations; its numbers are misleading.
  • Moving work "to the background" without control. If deferred initialisation competes with the first frame for CPU, users still feel the slowdown.
  • Trading stability for decorative smoothness. Aggressive optimisations that raise crash or ANR rates cancel out the speed gain.
  • One-off optimisation. Without a budget in CI, new features push startup back to where it was within a few releases.

We covered how to choose a test device fleet in our article on testing on inexpensive devices, and startup metrics in the piece on app startup speed.

What performance work gives the product

The Josh case shows that startup optimisation is audience work, not only technical-debt work. When an app becomes usable on modest devices, the team returns access to people who would otherwise have left. For Josh this showed up in bounce rate, retention and ratings; a similar link between speed and business metrics is described in the Zomato case.

Another effect highlighted in the case is organisational. Working on vitals brought the team together, and the learnings were later applied to other apps in the company. When performance becomes a shared metric rather than the job of a single "performance engineer", it is much easier to sustain.

Checklist before your next release

  • There is a baseline for cold, warm and hot start on three device classes.
  • Startup metrics are reviewed at p50, p90 and p95, not only as an average.
  • Every SDK in the startup path has an owner and a reason it is needed before the first frame.
  • Non-critical initialisation is deferred and does not compete with rendering the first screen.
  • Splash and first-screen graphics are optimised for display size.
  • Macrobenchmark runs in CI, and exceeding the startup budget stops the release.
  • After release, the team watches Android vitals, crash rate, ANR and retention in the low-end device segment.

Sources: Android Developers: Josh startup performance case study; Android Developers: App startup time; Android Developers: Macrobenchmark; Android Developers: Baseline Profiles.

Passkeys: Implementing Passwordless Sign-In in iOS and Android Apps

Passkeys: Implementing Passwordless Sign-In in iOS and Android Apps

Passwords are the weakest link in most mobile products: users forget them, reuse them and type them into phishing pages, while the team spends resources on account recovery, SMS codes and support. Passkeys take a different approach: instead of a secret the person knows, a cryptographic key pair whose private key never leaves the user's credential manager, with sign-in confirmed by Face ID, a fingerprint or the device PIN.

The technology is supported by iOS, Android and every major browser, and Apple and Google have built it into their system password managers. This article covers how passkeys work, what the backend and mobile client need, how to design the migration UX away from passwords and the details teams trip over most often.

How passkeys work

A passkey is a FIDO2 credential built on the W3C WebAuthn standard and FIDO Alliance specifications. At registration the device generates a key pair for a specific domain (the relying party ID). The public key is stored on your server, the private key in a credential manager: iCloud Keychain, Google Password Manager or a third-party one such as 1Password.

At sign-in the server sends a random challenge, the device signs it with the private key after a biometric check, and the server verifies the signature with the public key. The consequences that matter:

  • Phishing resistance. The key is bound to the domain: a passkey for example.com cannot be used on example-login.com.
  • Nothing to steal on the server. A leaked database of public keys does not let anyone sign in.
  • Sync. Passkeys sync across devices within an ecosystem, and on someone else's device you can sign in by scanning a QR code with a nearby phone (cross-device, or the hybrid transport).

Passwords, SMS and passkeys compared

CriterionPasswordSMS / e-mail codePasskey
Phishing resistanceLowLow (the code can be entered on a fake page)High, bound to the domain
User frictionRemember and typeWait for and copy a codeOne biometric gesture
Cost to the businessRecovery, supportPaying per SMS, SMS pumping riskOne-off integration
Impact of a database leakCritical with weak hashing—Public keys grant no access
Device dependencyNonePhone number, SIMCredential manager, sync

NIST SP 800-63B permits syncable authenticators and recognises domain-bound cryptographic authentication, as in WebAuthn, as phishing-resistant, while it classifies using the phone network for SMS codes as restricted. For products handling sensitive data this is a compliance argument, not just a UX one.

What the backend needs

The backend is the relying party server. There is no need to write cryptography from scratch: use proven libraries (SimpleWebAuthn for Node.js, Yubico's java-webauthn-server, py_webauthn, webauthn-rs, libraries for PHP and Go). A list is available at passkeys.dev.

  1. Registration endpoints: issue creation options (challenge, rp.id, user.id, excludeCredentials) and verify the response.
  2. Sign-in endpoints: issue a challenge and verify the signature.
  3. A credentials table: credential ID, public key, signature counter, AAGUID (authenticator model), created and last-used dates. One user can have several passkeys.
  4. The challenge must be cryptographically random, single-use and short-lived (usually a few minutes).
  5. user.id must be a random value with no personal data; Google suggests, for example, 16 random bytes rather than an e-mail address.
  6. Origin checks: the domain for the web, and for Android android:apk-key-hash: with the SHA-256 fingerprint of the signing certificate (Android documentation). Remember to allow both debug and release fingerprints.

iOS: AuthenticationServices and Associated Domains

Passkeys are available from iOS 16 through the AuthenticationServices framework (Apple: Supporting passkeys).

  • Add the Associated Domains capability with a webcredentials:example.com entry.
  • Host an apple-app-site-association file at https://example.com/.well-known/apple-app-site-association with your App ID under webcredentials (Supporting associated domains). It must be served over HTTPS without redirects.
  • For registration use ASAuthorizationPlatformPublicKeyCredentialProvider with a registration request; for sign-in, an assertion request with the server's challenge.
  • For AutoFill-assisted sign-in, mark the login field as a username and the system will offer the passkey right in the QuickType bar.
  • From iOS 18, automatic passkey upgrades are available: after a successful password sign-in the app can request passkey creation in conditional mode, without an extra dialog.

Android: Credential Manager and Digital Asset Links

On Android the recommended tool is Jetpack Credential Manager, which unifies passkeys, passwords and Sign in with Google in a single system bottom sheet. Passkeys are supported on devices running Android 9 (API 28) and later.

  • Add the androidx.credentials and credentials-play-services-auth dependencies.
  • Set up Digital Asset Links: an assetlinks.json file at https://example.com/.well-known/ with the app's package, SHA-256 fingerprint and the credential-sharing permission.
  • Registration uses CreatePublicKeyCredentialRequest with the server's JSON; sign-in uses GetPublicKeyCredentialOption in getCredential().
  • Handle every exception: user cancellation, no credentials, interruption (retryable), missing provider configuration.
  • The isConditional flag lets you create a passkey automatically after a password sign-in, the counterpart of automatic upgrades on iOS.

If you use Google Play App Signing, assetlinks.json must contain the fingerprint of the key Google signs the app with, not just your upload key. This is the most common reason passkeys work in debug but fail in the production build.

UX: migrating users away from passwords

Dropping passwords overnight is unrealistic. A workable plan is gradual rollout:

StageWhat we doMetric
1. Offer after sign-inAfter a successful password sign-in, offer to create a passkey or create one automaticallyShare of users with a passkey
2. Passkeys in settingsA Security section: list of passkeys, add, remove, last used dateActive passkeys per user
3. Passkey-first sign-inThe sign-in screen offers the passkey first, the password as a fallbackShare of passkey sign-ins, sign-in success rate
4. Sign-up with a passkeyNew accounts are created with a passkey and no passwordSign-up conversion
5. Optional password removalA user with 2+ passkeys may delete their passwordAccess-related support tickets

Wording matters. Not everyone knows the word "passkey" yet, so explain the benefit: "Sign in with Face ID, no password needed". Google provides recommended copy and icons in its passkey UX guidelines. Do not show the offer on every sign-in: if the user declines, ask again in a few weeks.

Recovery and edge cases

  • Lost device. Synced passkeys are restored with the Apple or Google account. You still need a fallback: an e-mail link, a second passkey, recovery codes. Its security sets the security of the whole system.
  • Mixed ecosystems. A user with an iPhone and an Android tablet: the second device can sign in via QR code or create its own passkey. Support several passkeys per account.
  • Third-party password managers. 1Password, Bitwarden and others store passkeys too; do not restrict authenticators without reason.
  • A passkey deleted on the server. It stays in the user's manager and keeps being offered. Use the Signal API where available, or a clear error that offers another sign-in method.
  • Corporate devices. MDM policies may disable Keychain sync; test those scenarios if your product is B2B.

Common mistakes

  • rp.id not matching the domain in apple-app-site-association / assetlinks.json, or a redirect on those files.
  • Missing release (or Play App Signing) fingerprint in assetlinks.json.
  • An e-mail address or phone number as user.id.
  • Reusing challenges, or not verifying them on the server.
  • Passkey as the only sign-in path with no fallback.
  • Treating a user cancelling the dialog as an error and showing an alarming message.
  • No analytics: without metrics you cannot tell whether passkeys actually reduce friction.

Implementation checklist

  1. Backend on a proven WebAuthn library; multiple passkeys per user; single-use challenges.
  2. apple-app-site-association and assetlinks.json on the rp.id domain, over HTTPS, without redirects.
  3. Debug, release and Play App Signing fingerprints on the server and in assetlinks.json.
  4. iOS: Associated Domains (webcredentials), AutoFill-assisted sign-in, automatic upgrades on iOS 18+.
  5. Android: Credential Manager, every exception handled, isConditional for automatic creation.
  6. UX: offer after sign-in, a Security section, a passkey-first sign-in screen, clear copy.
  7. Fallback sign-in and recovery paths with at least equal security.
  8. Metrics: share of passkey sign-ins, sign-in success rate, access-related tickets.

Sources: FIDO Alliance: Passkeys; W3C Web Authentication Level 3; Apple: Supporting passkeys; Apple: Supporting associated domains; Android: Credential Manager; Android: Create passkeys; Android: Credential Manager prerequisites; Android: Passkeys UX guidelines; Google Identity: Passkeys; passkeys.dev; NIST SP 800-63B.

Lyft: Why Fast Android Startup Matters for Drivers

Lyft: Why Fast Android Startup Matters for Drivers

In a service app, a delay is more than an inconvenience. For a driver waiting for a request or plotting a route, slow startup can mean a missed opportunity, a late arrival or lost income. Here, speed is part of the work tool, not a "nice bonus".

The Lyft case described on Android Developers is interesting not only for its result but also for how the team convinced leadership to invest in performance at a company where every project competes for resources. We break down what exactly they did, what numbers they got, and how we apply this approach when justifying performance work for our own products.

The Lyft case: how the task came about

Lyft is a ridesharing service used every day by millions of drivers and riders. The team kept an eye on performance and noticed that the Lyft Driver app on Android started slowly. But developers' impressions aren't an argument for leadership, so the first step was to show the scale of the problem.

Android vitals in Google Play Console helped here. A comparison with ten other apps in the category showed that Lyft Driver's startup time was 15–20% worse. The team then estimated the cost: one developer working for one month could make a significant improvement. The combination of "a clearly measured problem and a bounded investment" made the decision obvious for leadership.

Four startup phases and where the bottleneck was

The team chose time to interact as its main metric — that is, time to full display (TTFD), not just the first frame. Startup was broken down into four phases.

PhaseWhat happensAnalysis result
1. Process startthe system creates the app processno issues
2. ActivityUI rendering kicks offno issues
3. Bootstrapnetwork requests for the data the home screen needsthe bottleneck
4. Displaythe driver interface openswaits for bootstrap to finish

Profiling showed that time was lost in the third phase: the app waited on network responses before showing the working screen. The fixes were relatively simple:

  • after decomposing backend services, some network calls were removed from the critical launch path entirely;
  • calls that could run asynchronously were made asynchronous;
  • data needed later rather than at launch stopped blocking startup;
  • blocking calls were moved to the background;
  • data started being cached between sessions.

Note that there are no "magic" compiler optimisations here. The main gain came from reviewing what the first screen really needs. In our experience, network bootstrap is the most common cause of slow TTFD in service and e-commerce apps.

The result: from milliseconds to sessions

The changes delivered an average 21% reduction in startup time and a 5% increase in driver sessions. The second number matters more than the first: it translates a technical improvement into business language. Seeing the result, Lyft leadership expanded the app excellence initiative and took on other areas, including stability.

An important caveat: 5% more sessions is the result for a specific product with a specific audience. It can't be mechanically transferred to another app. But the logic — tying speed to the user's key action — is always worth transferring.

Why context matters more than the average

What you should measure is not an abstract startup but a critical business scenario. In a driver app that might be going online, accepting a ride, the map or confirming completion. For a store — the catalogue and cart; for a bank — the balance and a transfer.

  • Define the moment after which the user can actually work, and mark it with reportFullyDrawn(), as Lyft did with time to interact.
  • Measure cold, warm and hot starts separately. A driver switching between a navigation app and yours experiences mostly warm and hot starts.
  • Segment data by device class and network conditions. The average hides drivers on old phones and in areas with weak coverage.
  • Check that optimisation doesn't hurt stability. Caching and asynchrony add new states that need testing.

How to build a business case for performance

  1. Gather a market comparison. Android vitals shows startup time against a peer group; Xcode Organizer shows trends by version on iOS.
  2. Pick one product metric that speed can influence: sessions, conversion to the key action, day-one retention.
  3. Scope the investment tightly: "one developer, four weeks" is more convincing than "a big optimisation".
  4. Break startup into phases and find the one that takes the most time.
  5. Start with the simplest changes: remove unnecessary requests, cache, defer what isn't important.
  6. Ship changes as a controlled release and compare the technical and product metrics against a control group.
  7. Show the result to leadership and propose the next step — as the Lyft team did.

We covered the more engineering-heavy side — what to do once network bootstrap is optimised but startup is still slow — using the examples of Gmail Wear OS and Android Calendar with Baseline Profiles.

Typical mistakes

  • Optimising TTID while the user is actually waiting for network data after the first frame.
  • Sequential requests at startup, each waiting for the previous one.
  • No cache between sessions: the app starts from an empty screen every time.
  • Justifying performance work with impressions rather than a market comparison and a product metric.
  • Prioritising the performance backlog separately from product and operations teams.
  • Not checking whether cached data has become so stale that it misleads the user.

Action plan

  1. Define the key action users open the app for, and mark the moment the app is ready for it.
  2. Compare your startup time with peers in Android vitals.
  3. Break startup into phases and measure each.
  4. Remove from the critical path every network request the first screen can do without.
  5. Add caching between sessions with honest indication of data freshness.
  6. Ship changes in a controlled release and compare technical and product metrics.
  7. Add the startup metric to the product team's regular report.

Speed becomes a business advantage when it supports a user's specific job. That's why the performance backlog must be prioritised together with product and operations teams. You'll find the general framework of startup metrics in our article on app startup speed.

Sources: Android Developers: Lyft improves Android app startup time; Android Developers Blog: How a single Android developer improved Lyft's Drivers app startup time by 21% in one month; Android Developers: App startup time; Android vitals: App startup time.

Gmail Wear OS: How the Team Improved App Startup by 50%

Gmail Wear OS: How the Team Improved App Startup by 50%

The small screen and limited resources of a wearable make every delay noticeable: a person raises their wrist for a few seconds, and if the app hasn't shown the mail by then, the moment is gone. The Gmail Wear OS case study published on Android Developers shows how a methodical startup analysis helps uncover non-obvious causes of a slow first screen.

The case is valuable less for its result than for the transparency of its method: the team shows step by step where to look in a trace and how to interpret what you see. We use the same analysis sequence in our own Android projects, so below is a breakdown of the case with practical commentary.

Context: why a watch is a tough test

The Gmail Wear OS team had its own performance criteria for startup and rendering and worked to meet them. An important detail the case highlights: the device had only two CPU cores. On such hardware, any parallel work — animation, background initialisation, system processes — competes with the main thread far more noticeably than on a modern eight-core phone.

The authors note that even if you have no formal thresholds, there's almost always room to improve startup if you take time to investigate. For a first assessment, you can compare your app against a peer group in Play Console and simply trust your instincts: if startup feels slow, it is.

How they found the problem: five points in the trace

The team recorded a system trace and analysed it in Perfetto, because it shows what's happening across the whole device, not just in your process. Here's what they looked at and what it means.

What to look at in the traceWhat it signalsWhat to do
The Android App Startups rowstartup boundaries up to the first frame (TTID)pin it to the top and analyse everything in that interval
Runnable vs Running ratio on the main threadthe thread is ready to work but doesn't get the CPU — contentionlook for intensive parallel work, especially animations
OpenDexFilesFromOat*time spent reading the app's DEX filesreduce code size with R8 minification
Binder transactionssystem service calls that may block startupdefer non-essential calls until after startup
Jit thread poolcode is compiled on the fly instead of ahead of timeextend the Baseline Profile to the point the screen is ready

Main thread and CPU contention

After selecting the startup interval on the main thread, the team examined the Thread States panel. The more time the thread spends in Runnable relative to Running, the more likely there's CPU contention: the thread is ready to run, but the scheduler gives the core to something else. The visible app has the highest priority, so an idle main thread often means it's being "interrupted" by intensive work inside the app itself — for example, animation rendering.

Binder transactions

The first binder transaction turned out to be long. Following the reply to the system process, the team saw a Runnable (Preempted) state and display controller events with higher priority. The conclusion: this was important system work — putting frames on the screen — and they left it as is. We consider this one of the most useful episodes in the case: not every finding in a trace needs fixing, and knowing when to stop saves days of work.

JIT activity

The app already had a Baseline Profile, so JIT barely ran before the first frame. But right after it, noticeable background compilation appeared. The fix was to extend profile collection: in the Macrobenchmark generation test, wait for a specific element that indicates the screen is fully populated.

What worked

  • A static state instead of a spinner. Having noticed CPU contention, the team replaced the animated loading indicator with a single static image.
  • Deferred shimmer. The splash screen was prolonged to defer shimmer — the second loading state — and free up CPU resources.
  • R8 rewriting of Baseline Profiles. Based on the OpenDexFilesFromOat* and JIT analysis, the team enabled profile rewriting via R8, which requires AGP 8.2 or newer.
  • A process, not a one-off. The team recommends setting up automated collection of traces and results through benchmarking.

As a result, the first group of changes — the static image and deferred shimmer — improved startup latency by 50%, and R8 rewriting by another 20%. These aren't universal percentages for every product, but they're a good example of engineering discipline: measure, find the bottleneck, change one cause and measure again. We examined how animation in general affects speed and perception in our article on animation in mobile interfaces.

How to repeat the analysis in your project

  1. Build a release-like variant: a debug build disables ART optimisations and the trace won't be representative.
  2. Record a cold-start trace on the weakest target device — via on-device system tracing or Macrobenchmark.
  3. Open the trace in Perfetto, pin Android App Startups and the two main-thread rows.
  4. Assess Runnable/Running. If Runnable is significant, look for animations and parallel tasks in that interval.
  5. Check OpenDexFilesFromOat*, binder transactions and the Jit thread pool using the table above.
  6. Form one hypothesis, make one change, re-measure on the same device.
  7. Validate the result with an A/B test or controlled release, and reject the change if it had no effect.

Typical mistakes in this kind of analysis

  • Adding loading indicators when you don't know what to optimise: they mask the problem and consume resources themselves.
  • Fixing everything that looks suspicious instead of starting with the longest frame.
  • Ignoring hardware context: on a two-core device, high Runnable time is partly expected.
  • Ending Baseline Profile collection at the first frame.
  • Judging impact on a single launch instead of a series of measurements.

Checklist

  1. There's a reproducible way to record a cold-start trace.
  2. Five points are checked: startup boundaries, Runnable/Running, DEX, binder, JIT.
  3. Startup animations are replaced with static states where they compete with the first screen.
  4. The Baseline Profile covers the journey until the screen is fully ready; R8 rewriting is enabled.
  5. Every change is validated by re-measurement and an A/B test.
  6. Trace collection is automated in CI.

Teams often add loading indicators when they don't know what to optimise. This case is a reminder that sometimes the best animation is the one you don't have to run. We described the broader framework of startup metrics in our article on app startup speed, and the role of Baseline Profiles in another example in our breakdown of the Android Calendar case.

Sources: Android Developers: How Gmail Wear OS improved app startup; Android Developers: App startup time; Android Developers: Baseline Profiles overview; Perfetto documentation.

Android Developer Verification: Global Launch in January 2027 and a Checklist for Your Team

Android Developer Verification: Global Launch in January 2027 and a Checklist for Your Team

Google is preparing a global launch of Android developer verification. The protections have been live since 30 September 2026 in Brazil, Indonesia, Singapore and Thailand, and the global rollout begins in January 2027. Here is what changes and what your team should do now.

All facts come from the Android Developers Blog post.

What is happening

Verification was announced in 2025 as an extra security layer that makes it harder for bad actors to repeatedly spread harm. After more than a year of preparation with partners, protections went live for participating stores in four countries. The global rollout starts in January 2027 with seven distributors: Google Play, Galaxy Store, Honor, Oppo, Xiaomi, Transsion and Vivo. Over several months the protections will expand to all countries and all installation sources on certified Android devices.

Registration so far

According to Google, millions of apps have been registered since verification opened to everyone in March. They represent over 99% of all Android app installs globally, via any distribution channel.

What was added based on developer feedback

  • Limited distribution accounts for students and hobbyists: share apps without registration fees or a government ID check. The authorized-device limit grew from 20 to 50.
  • Android Developer ID Status API and Android Developer Console API: automate app registration from CI pipelines for teams with many apps.
  • An advanced flow for power users: install an unregistered app by knowingly accepting the risk, while guardrails against social-engineering scams stay in place for everyday users.

A checklist for your team

  • You publish on Google Play: check package registration status in Play Console and register any unregistered apps, including those you distribute outside Play.
  • You distribute only outside Google Play: create an Android Developer Console account, verify your identity and register your apps.
  • You publish on open-source registries: Google has a dedicated guide for registering existing and new apps.
  • You manage many apps: consider registering through the API from CI instead of by hand.

Google says registering an app takes under ten minutes. The risk of skipping it is that installing your app stops being seamless wherever the protections are live.

Bottom line

There is little time before January, and the work is simple: inventory packages, verify the account, register the apps. Teams that hand out builds outside Google Play (enterprise, regional and test channels) should be especially careful.

Google Play for Games: Foldable Screenshots from April 2027 and Tier 3 from August 2027

Google Play for Games: Foldable Screenshots from April 2027 and Tier 3 from August 2027

On 18 November 2026 Google Play announced new requirements for games on large screens and foldables. Two dates are already set: from April 2027 a game's listing must include foldable screenshots, and from August 2027 a game must meet the baseline Tier 3 of the large screen quality guidelines. Otherwise new games and updates cannot be published.

For game studios this means planning testing and art for several form factors well in advance. Below we go through what exactly Google requires, what Tier 3 covers and what to prepare now.

What Google announced

The Android Developers Blog post of 18 November 2026 describes two requirements:

  • Foldable screenshots (April 2027). New games and store listing updates need at least 3 foldable screenshots in addition to 1 standard phone screenshot, in the game's primary orientation. You can already upload them in Play Console (Grow → Store presence → Store listings).
  • Baseline Tier 3 "Ready" (August 2027). To publish new games and updates, a game must meet at least this level of the large screen and foldables guidelines.

The August milestone focuses on foldables first. Google says the requirements will later extend to tablets, Googlebook laptops and other large screens.

Which screenshots you need

The formats depend on the device type:

  • Standard phones: a screenshot in the game's primary orientation, 16:9 (landscape) or 9:16 (portrait).
  • Foldables with a 1:1 inner display (for example Samsung Galaxy Z Fold8 Ultra, Google Pixel 11 Pro Fold): at least one screenshot of the unfolded 1:1 inner screen. No separate outer screen screenshot is needed because its aspect ratio matches standard phones.
  • Foldables with a 4:3 inner display (for example Samsung Galaxy Z Fold8): at least one screenshot of the 4:3 (or 3:4) inner screen and one of the 16:10 (or 10:16) outer screen.

Screenshots from the Android Emulator's 1:1 and 4:3 foldable devices fully comply with the new Play Console requirements.

The three quality tiers

TierWhat is evaluatedStatus
Tier 3: ReadyFull-screen rendering in supported orientations, unobstructed HUD safe areas, clean in-engine letterbox/pillarbox in unsupported orientations, state and touch alignment preserved across folding, unfolding, rotation and multi-window resizingRequired from August 2027
Tier 2: OptimizedHigh-resolution graphics, proportional HUD scaling, styled framing when letterboxing, smooth frame pacing, full playability with external controllers, keyboards and miceBadging and enhanced merchandising
Tier 1: DifferentiatedSustained 60 FPS (120 FPS on supported displays), thermal and battery stability in long unfolded sessions, efficient modern graphics rendering, dynamic resolution scaling between inner and cover screensBadging and enhanced merchandising

Google notes that Tier 1 and Tier 2 unlock foldable badging on the Play Store, enhanced merchandising and a path to the Google Play Games Level Up program.

What to check in your game

  1. Configuration changes without losing progress. Folding and unfolding the device must not restart the session or reset level progress.
  2. HUD safe areas. UI elements must not be cut off or stretched on the unfolded screen.
  3. Unsupported orientation. If the game supports a single orientation, it should add bars cleanly inside the engine when rotated.
  4. Touch alignment. After the window is resized, touch points must match what the player sees.
  5. Multi-window. Check behavior in a resizable window.

Google points out that with modern engines much of the foundation is already in place: Unity and Unreal have dedicated guides for large screens and resizing.

Timeline

  • November 2026: you can upload foldable screenshots; they will appear in listings over the next few weeks.
  • April 2027: new games and updates must include foldable screenshots at submission.
  • August 2027: baseline Tier 3 is required to publish new games and updates.

You can test on physical devices, in Android Device Streaming, in engine simulators (Unity Device Simulator, Unreal viewport profiles) and in the Android Emulator for 1:1 and 4:3 form factors.

Conclusion

There is enough time to prepare, but game design and UI are the hardest things to change at the last minute. A practical order: capture foldable screenshots, run the game against the Tier 3 checklist on the 1:1 and 4:3 emulators, fix state loss and HUD issues, then look at Tier 2 for badging and merchandising.

Need a foldable audit for your game or help adapting the interface? Get in touch: we will look at your build and propose a plan.

Jetpack Compose 1.13: What Is Deprecated, What Changed and What to Migrate Now

Jetpack Compose 1.13: What Is Deprecated, What Changed and What to Migrate Now

On 18 November 2026 stable Jetpack Compose 1.13 shipped (BOM 2026.11.01). It is not only about new effects: the release deprecates several familiar tools and changes how clickable elements behave. Below we go through what to migrate now and what can wait.

All facts below come from the Android Developers Blog post.

Upgrade requirements

Moving to BOM 2026.11.01 requires Kotlin 2.2 or newer and compileSdk 37.1. If a project is still on an older toolchain, start the upgrade there:

implementation(platform("androidx.compose:compose-bom:2026.11.01"))

What is deprecated

WhatWhat changedWhat to move to
Value-based BasicTextField and Material 2 TextFieldOfficially deprecatedState-based BasicTextField with TextFieldState; in Material 3 the value-based overloads are not deprecated yet, but Google recommends migrating
VisualTransformationDeprecatedOutputTransformation and InputTransformation
Compose Material 2Deprecated and no longer actively maintainedMaterial 3 1.5.0
ConstraintLayout and MotionLayout in ComposeDeprecated (the constraintlayout-compose artifact)Modern Compose layout and animation tools, including the Shared Element APIs
Modifier.onFocusedBoundsChangedImplementation removed; the modifier has no effectFocusTargetModifierNode.getFocusedRect(), onFocusChanged, BringIntoViewRequester

Built-in scrolling containers such as LazyColumn and Modifier.verticalScroll already bring focused content into view, so the removed modifier does not affect them.

What was added

  • FlexBox and Grid are stable. FlexBox gained maxItemsInEachLine and, according to Google, supersedes FlowRow and FlowColumn in new code.
  • computedStateOf is a lighter alternative to derivedStateOf for condition checks and filtered state computed from frequently changing values such as scroll position. It does not cache the result, so it has less overhead. Keep derivedStateOf for heavy calculations or where caching is needed.
  • Stable LazyLayoutCacheWindow. Window-based prefetching replaces item-based prefetching in lists, grids and staggered grids; the cache window settings moved from rememberLazyListState into the layout composables themselves.
  • Progressive blur, PolygonShape and MorphPolygonShape. Blur properties can be set directly on DialogProperties.
  • CapturedAnimatedVisibility. It animates a snapshot of the last frame instead of keeping state alive, which helps when data disappears immediately (for example closing a details pane sets the selected item to null). In Google's benchmarks, frame time during exit is 7–8% faster than with AnimatedVisibility.
  • TestFailurePolicy. It automatically saves a screenshot and the semantics tree when a UI test fails, which is handy in CI.
  • Material 3 1.5.0. Experimental annotations dropped from 120 to 58; Slider and RangeSlider moved to SliderState.

Behavior change: click sounds

Elements using Modifier.clickable (and components built on it) now automatically play standard Android interaction sounds, respecting the user's system sound settings. If you previously triggered such sounds manually or deliberately avoided them, check screens with clickable elements after the upgrade.

Performance: what the numbers say

Google states that on a Pixel 6, Compose 1.13 matches version 1.12.1 on baseline startup and scrolling benchmarks with a 0% jank rate. Cold start Time to Initial Display is 147.65 ms for Compose versus 152.87 ms for Views. Views are still faster on Time to Full Display (180.32 ms versus 202.79 ms for Compose), and P50 scrolling frame duration is 3.51 ms for Compose versus 3.06 ms for Views.

On the tooling side there is Perfetto recomposition tracing (recording state reads and writes) and a static analysis performance skill available through Android CLI. Google warns that recomposition tracing adds overhead, so disable it when measuring performance.

Migration plan

  1. Update the toolchain: Kotlin 2.2+ and compileSdk 37.1, then BOM 2026.11.01.
  2. Find deprecated APIs: value-based text fields, ConstraintLayout in Compose, Material 2, onFocusedBoundsChanged.
  3. Start with text fields: moving to TextFieldState changes the state model, so do it as a separate step.
  4. Walk through clickable screens: check the new system sounds.
  5. Measure: compare startup and scrolling before and after on real devices.

Two experimental tracks are worth knowing about: the Styles API remains experimental, and the androidx.web:web:1.0.0-alpha01 library and the A2UI renderer (material3-a2ui:1.0.0-alpha02) are still alpha, so do not plan production work on them.

Conclusion

Compose 1.13 does not break an app out of the box, but it clearly shows what will be removed next: value-based text fields, Material 2 and ConstraintLayout in Compose. It is better to plan the migration across the next sprints than to do it all at once alongside other changes.

Need help migrating a Compose app or an audit of your UI code? Get in touch: we will look at the project and propose a plan.

Android Calendar and Baseline Profiles: How Startup Optimization Reduces Jank

Android Calendar and Baseline Profiles: How Startup Optimization Reduces Jank

Mobile app optimisation often starts with a feeling that "it's slow", but it should end with a measurable result. Baseline Profiles give a team a way to describe the most important code paths in advance and reduce the work a device does during the first launches and in key journeys.

The Android Calendar case study published on Android Developers is one of the best-documented examples: it has the motivation, the specific journeys, the measurement method and before-and-after numbers. We break it down in detail and add what we see when introducing profiles in our own Android projects.

How Baseline Profiles work

When an Android app launches for the first time after installation, a large share of its code runs in the interpreter or is compiled on the fly by the JIT compiler. That costs CPU time exactly when the user is waiting for the first screen. A Baseline Profile is a list of classes and methods worth compiling in advance. The profile ships with the build, and at install time the system compiles that code ahead of time.

According to Android documentation, Baseline Profiles speed up code execution by about 30% from the first launch, because they skip interpretation and JIT for key journeys. Profiles help not only startup but also smoothness: scrolling, screen transitions, opening complex lists.

There's another mechanism — Cloud Profiles, which Google Play builds automatically from real-world app usage. The Calendar team already had Cloud Profiles, so it's important to understand the difference.

ParameterCloud ProfilesBaseline Profiles
Setupenabled by defaultconfigured by the team
Which journeys are includedchosen automatically from user datachosen by the team
Work best for a user base that islargeany size
When the impact appearsa few days after releaseimmediately
Android versionsAndroid 9 (API 28) and higherAndroid 7 (API 24) and higher

Why the Calendar team needed its own profiles

The main reason was the move to a weekly release cycle. Cloud Profiles reach peak impact only 1–2 days after a version ships, because they rely on aggregated user data. With a weekly cycle, that means people spend a large share of the time on an unoptimised build. Baseline Profiles take effect from the first minute after the update is installed.

The second reason was control. The team wanted to choose the critical user journeys (CUJs) included in the profile themselves. There were two:

  • Opening the app in schedule view — the default view, so it matters for new users and those who don't change settings.
  • Opening the app in month view — according to analytics, many users choose it.

Profiles were generated through an internal wrapper around Jetpack Macrobenchmark: the test launches the app, waits for recurring events and tasks to appear on screen, opens the side drawer and verifies the selected view. Note the detail: the test waits for real content, not just the first frame.

How they measured the result without an A/B test

Baseline Profiles are tightly bound to the APK and are applied before the code runs, so a classic A/B experiment within one version is impossible. The team used controlled releases: only a subset of users received the new version, and its metrics were compared with a group on a version as close as possible to the previous one. Results were aggregated across a wide range of devices:

  • median interactive startup — the most common scenario — dropped from 775 to 644 ms (17%);
  • median cold start — from 1,058 to 901 ms (15%);
  • median warm start — from 453 to 378 ms (17%);
  • the median janky frame rate in schedule and month views decreased by 42–60%.

Overall, the team reports roughly a 20% startup improvement and about a 50% reduction in slow or frozen frames. Even users who open other views benefited: shared processes, such as loading calendar data from the database, were also covered by the profile. The documentation adds a caveat: if Cloud Profiles run in parallel, the difference shrinks slightly during the first week as cloud profiles "catch up".

How to introduce Baseline Profiles: step by step

  1. Pick 2–4 critical journeys. Cold start to the main screen, the most popular transition, the main scrolling list. Use analytics data, not assumptions.
  2. Add the Baseline Profile Gradle plugin and create a module for profile generation. Android Studio has a ready-made template.
  3. Write the generator with BaselineProfileRule. Take the journey to the point where the screen is genuinely populated: wait for a specific UI element. For startup, enable includeInStartupProfile to also get DEX layout optimisation.
  4. Generate the profile on an emulator or physical device and commit the result to the repository.
  5. Measure the effect with Macrobenchmark: compare CompilationMode.None with CompilationMode.Partial using the profile, with StartupTimingMetric and FrameTimingMetric.
  6. Enable R8. R8 rewriting of profiles requires AGP 8.2 or newer; in the Gmail Wear OS case study, that alone added another 20% to startup speed.
  7. Automate regeneration. A profile ages along with the code — regenerate it in CI before every release.
  8. Check field data in Android vitals after a controlled release.

What matters for other teams

  • Profile real key journeys, not a random set of screens.
  • Check results across device classes: the gain is usually largest on weak devices. We explained why this matters in our article on testing on inexpensive devices.
  • Compare controlled groups when an A/B test isn't possible.
  • Combine profiles with Macrobenchmark in the lab and field metrics in Play Console.

Typical mistakes

  • Expecting profiles to fix poor architecture. If Application.onCreate synchronously initialises a dozen SDKs, a profile will only speed up unnecessary work a little.
  • Generating a profile once and forgetting it: a few releases later it covers the wrong code.
  • Measuring on a debug build, where profiles and R8 don't behave as in release.
  • Ending the generation journey at the first frame, so data-loading code never makes it into the profile.
  • Not checking whether the profile actually gets installed: ProfileVerifier in the ProfileInstaller library exists for that.

Checklist

  1. 2–4 critical journeys are defined based on analytics.
  2. The profile generation module works and runs in CI.
  3. There's a Macrobenchmark for startup and smoothness comparing "no profile / with profile".
  4. R8 is enabled and AGP 8.2+ is used.
  5. The effect is confirmed by a controlled release and Android vitals data.
  6. Results are tied to product metrics: abandonment, rating, completion of the key action.

Baseline Profiles work best when the team already knows which path has to be fast. We laid out the general framework of startup metrics in our article on app startup speed. For the business, it's important to link the technical improvement to behaviour: faster startup can reduce abandonment and raise ratings, but that has to be verified with data, not assumed.

Sources: Android Developers: Android Calendar Baseline Profiles case study; Android Developers: Baseline Profiles overview; Android Developers: Benchmark Baseline Profiles with Macrobenchmark; Android Developers: Gmail Wear OS startup case study.

Journal

Ideas and products