Category Archives: Android Developers Blog

An Open Handset Alliance Project

Optimize for Android (Go edition): Lessons from Google apps – Part 1

Posted by Niharika Arora, Developer Relations Engineer

The Android operating system brings the power of computing to everyone. This vision applies to all users, including those on entry-level phones that face real constraints across data, storage, memory, and more.
This was especially important for us to get right because, when we first announced Android (Go edition) back in 2017, people using low-end phones accounted for 57% of all device shipments globally (IDC Mobile Phone Tracker).


What is Android (Go edition)?

Android (Go edition) is a mobile operating system built for entry-level smartphones with less RAM. Android (Go edition) runs lighter and saves data, enabling Original Equipment Manufacturers (OEMs) to build affordable, entry-level devices that empower people with possibility. RAM requirements are listed below, and for full Android (Go edition) device capability specifications, see this page on our site.

Year

2018

2019

2020

2021

2022

2023

Release

Android 8

Android 9

Android 10

Android 11

Android 12

Android 13

Min RAM

512MB

512MB

512MB

1GB

1GB

2GB



Android (Go edition) provides an optimized experience for low-RAM devices. By tailoring the configuration and making key trade-offs, we’re able to improve speed and performance for low-end devices and offer a quality phone experience for more than 250M people around the world.


Recent Updates

We are constantly making phones powered by Android (Go edition) more accessible with additional performance optimizations and features designed specifically for new & novice internet users, like translation, app switching, and data saving.

Below are the recent improvements we made for Android 12:

Faster App Launches

Longer Battery Life 

Easier App Sharing 

More Privacy Control





Why build for Android (Go edition)?

With the fast growing & easily accessible internet, and all the features available at low cost, OEMs and developers are aiming & building their apps specifically for Android (Go edition) devices.

Fast forward to today — over 250 million+ people worldwide actively use an Android (Go edition) phone. And also considering the big OEMs like Jio, Samsung, Oppo, Realme etc. building Android (Go edition) devices, there is a need for developers to build apps that perform well especially on Go devices.

But the markets with the fast growing internet and smartphone penetration can have some challenging issues, such as:
  • Your app is not starting within the required time limit.
  • A lot of features/required capabilities increases your app size 
  • How to handle memory pressure while working on Go apps?


Optimize your apps for Android (Go edition)

To help your app succeed and deliver the best possible experience in developing markets, we have put together some best practices based on experience building our own Google apps Gboard & Camera from Google.


Approach

Define Metrics & breakdowns → Benchmark Metrics → Identify bottlenecks → Optimize bottlenecks → Add regression tests.        ↑_________________________________↓

Phases

Description

DefineBefore starting any optimization effort, it’s important to define the goals. Key Performance Indicators (KPIs) have to be defined for the app.
  • KPIs can be common across different apps and some can be very specific. Some examples of KPIs can be  
KPICategory
App Startup Latency
Common to all apps
App Crash Rate
Common to all apps
End to end latency for CUJ - Camera Shot
Specific to Camera app
App Not Responding RateCommon to all apps
  • Once KPIs are defined the team should agree on the target thresholds. This can be derived from the minimum user experience/benchmarks in mind.
  • KPIs should ideally be defined from the perspective of balancing User Experience and technical complexity.
BreakdownOnce KPIs are defined, the next steps could be to break down a given KPI into individual signal metrics.
  • For example → End to end latency for CUJ (shots in Camera) can be divided into → Frame capture latency, image processing latency, time spent on saving a processed image to disk etc.
  • Similarly, App Crash Rate can be bucketed into → Crash due to unhandled errors, Crash due to high memory usage, Crash due to ANR etc.
BenchmarkBenchmark or measure the KPI values and individual metrics to identify current performance.
If KPI targets are met, things are good. If not → identify the bottlenecks by looking at the individual breakdowns.
Repeat the process


After optimizing a certain bottleneck go back and benchmark the metrics again to see if the KPI targets are met. If not, repeat the process. If yes, great job!
Add Regular regression testThat either runs for every change or in some frequency to identify regressions in KPIs. It is more difficult to debug and find sources of regressions or bugs than to not allow them to get into the codebase. Don’t allow the changes that fail the KPI goals unless the decision is to update the KPI targets.
  • Try to invest in building a regression infrastructure to deal with such issues in early stages.
  • Decide on how often tests should run? What should be the optimal frequency for your app?



Optimize App Memory

GBoard used the onTrimMemory() signal to trim unneeded memory while it goes in the background and there is not enough memory to keep as many background processes running as desired, for example, trimming unneeded memory usage from expressions, search, view cache or openable extensions in background. It helped them reduce the number of times being low memory killed and the average background RSS. Resident Set Size(RSS) is basically the portion of memory occupied by your app process that is held in main memory (RAM). To know more about RSS, please refer here. 
  • Check if malloc can be replaced with mmap when accessing read-only & large files: mmap is only recommended for reading a large file onto memory ('read-only memory mapped file'). The kernel has some special optimizations for read-only memory mapped files, such as unloading unused pages.
Typically this is useful for loading large assets or ML models.
  • Scheduling tasks which require similar resources(CPU, IO, Memory) appropriately: Concurrent scheduling could lead to multiple memory intensive operations to run in parallel and leading to them competing for resources and exceeding the peak memory usage of the app. The Camera from Google app found multiple problems, ensured a cap to peak memory and further optimized their app by appropriately allocating resources, separating tasks into CPU intensive, low latency tasks(tasks that need to be finished fast for Good UX) & IO tasks. Schedule tasks in right thread pools / executors so they can run on resource constrained devices in a balanced fashion.
  • Find & fix memory leaks: Fighting leaks is difficult but there are tools like Android Studio Memory Profiler/Perfetto specifically available to reduce the effort to find and fix memory leaks.
Google apps used the tools to identify and fix memory issues which helped reduce the memory usage/footprint of the app. This reduction allowed other components of the app to run without adding additional memory pressure on the system.

An example from Gboard app is about View leaks
A specific case is caching subviews, like this: 
 

void onKeyboardViewCreated(View keyboardView) {
  this.keyButtonA = keyboardView.findViewById(...);
  ...
}
 

The |keyboardView| might be released at some time, and the |keyButtonA| should be assigned as null appropriately at some time to avoid the view leak.

Lessons learned:
    • Always add framework/library updates after analyzing the changes and verifying its impact early on.
    • Make sure to release memory before assigning new value to a pointer pointing to other object allocation in heap in Java. (native backend java objects) 
For example :
In Java it should be ok to do
 

ClassA obj = new ClassA("x");
// ... something
obj = new ClassB("y");

 
GC should clean this up eventually.
 
if ClassA allocates native resources underneath and doesn't cleanup automatically on finalize(..) and requires caller to call some release(..)  method, it needs to be like this 
 

ClassA obj = new ClassA("x");
// ... something

// Explicit cleanup.
obj.release();

obj = new ClassB("y");

 
else it will leak native heap memory. 
  • Optimize your bitmaps: Large images/drawables usually consume more memory in the app. Google apps identified and optimized large bitmaps that are used in their apps. 
Lessons learned :
    • Prefer Lazy/on-demand initializations of big drawables.
    • Release view when necessary.
    • Avoid using full colored bitmaps when possible. 
For example: Gboard’s glide typing feature needs to show an overlay view with a bitmap of trails, which can only has the alpha channel and apply a color filter for rendering.
 

// Creating the bitmap for trails.

trailBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ALPHA_8);

...

// Setup paint for trails.

trailPaint.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(new float[] {

  0, 0, 0, 0, (color >> 16) & 0xFF,

  0, 0, 0, 0, (color >> 8) & 0xFF,

  0, 0, 0, 0, color & 0xFF,

  0, 0, 0, 1, 0

})));

...

// onDraw

@Override

protected void onDraw(Canvas canvas) {

  super.onDraw(canvas);

  if (trailBitmap != null) {

    canvas.drawBitmap(trailBitmap, 0, 0, trailPaint);

  }

}

 
A screenshot of glide typing on Gboard
  • Check and only set the alpha channel for the bitmap for complex custom views used in the app. This saved them a couple of MBs (per screen size/density).
  • While using Glide, 
    • The ARGB_8888 format has 4 bytes/pixel consumption while RGB_565 has 2 bytes/pixel. Memory footprint gets reduced to half when RGB_565 format is used but using lower bitmap quality comes with a price too. Whether you need alpha values or not, try to fit your case accordingly.
    • Configure and use cache wisely when using a 3P lib like Glide for image rendering.
  • Try to choose other options for GIFs in your app when building for Android (Go edition) as GIFs take a lot of memory.
  • The aapt tool can optimize the image resources placed in res/drawable/ with lossless compression during the build process. For example, the aapt tool can convert a true-color PNG that does not require more than 256 colors to an 8-bit PNG with a color palette. Doing so results in an image of equal quality but a smaller memory footprint. Read more here.
  • You can reduce PNG file sizes without losing image quality using tools like pngcrush, pngquant, or zopflipng. All of these tools can reduce PNG file size while preserving the perceptive image quality.
  • You could use resizable bitmaps. The Draw 9-patch tool is a WYSIWYG editor included in Android Studio that allows you to create bitmap images that automatically resize to accommodate the contents of the view and the size of the screen. Learn more about the tool here

Recap

This part of the blog outlines why developers should consider building for Android (Go edition), a standard approach to follow while optimizing their apps and some recommendations & learnings from Google apps to improve their app memory and appropriately allocate resources.

In the next part of this blog, we will talk about the best practices on Startup latency, app size and the tools used by Google apps to identify and fix performance issues.

Privacy Sandbox: Developer Preview 5 is here!

Posted by Fred Chung, Android Developer Relations

Today, we’re releasing the Privacy Sandbox on Android Developer Preview 5 ‒ it’s a major milestone that will become the foundation for upcoming Privacy Sandbox Beta releases.

We appreciate that many of you have tested the Developer Preview and have reported issues and shared your feedback. This feedback has helped us evolve the Privacy Sandbox design. For example, we have modified the SDK Runtime design to allow reflection API usage, and have published additional design proposals on FLEDGE services, mediation, and app-to-web measurement.

Let’s have a look at the specifics in this release.


What’s in Developer Preview 5?

Developer Preview 5 includes additional functionality, data validation enhancements, and API signature changes across the privacy preserving APIs and the SDK Runtime. See the release notes for details.


Attribution Reporting API



FLEDGE on Android API

  • To provide up-to-date data for auctions, you can set up a daily fetch URL to update custom audience AdData lists and other metadata.
  • This release incorporates various API signature changes and additional parameter validation to ensure robustness. Refer to the release notes for details. Be sure to update the sample code and your test projects using previous Developer Preview releases.


SDK Runtime

  • Apps get additional control on runtime enabled SDK lifecycle events, such as when the SDK is unexpectedly terminated by the platform. Implementing the SdkSandboxLifecycleCallback allows the app to take appropriate actions to recover.
  • After successfully loading an SDK, apps now have access to an IBinder interface to facilitate 2-way communications with the runtime-enabled SDK.


Topics API

  • Updated taxonomy for classification of mobile apps.


AdServices permissions

  • App developers must now declare AdServices permissions to access the privacy preserving APIs. Learn more.

In the coming months, we’ll continue to use the Developer Previews to innovate and implement new features. We’ll publish more details about the Beta and these future releases in the coming months.


Get started with Developer Preview 5

With today’s Developer Preview release, we hope to continue working with the industry and developers to get prepared for Privacy Sandbox on Android. The release provides the resources you need to begin early testing of features and share feedback. To get started developing, see instructions to set up the SDK and system images on the emulator or supported Pixel devices.

For more information on the Privacy Sandbox on Android Developer Preview, visit the developer site and sign up for our newsletter to receive regular updates.

#WeArePlay | Meet Sam from Chicago. More stories from Peru, Croatia and Estonia.

Posted by Leticia Lago, Developer Marketing

A medical game for doctors, a language game for kids, a scary game for horror lovers and an escape room game for thrill seekers! In this latest batch of #WeArePlay stories, we’re celebrating the founders behind a wonderful variety of games from all over the world. Have a read and get gaming! 


To start, let’s meet Sam from Chicago. Coming from a family of doctors, his Dad challenged him to make a game to help those in the medical field. Sam agreed, made a game and months later discovered over 100,000 doctors were able to practice medical procedures. This early success inspired him to found Level Ex - a company of 135, making world-class medical games for doctors across the globe. Despite his achievements, his Dad still hopes Sam may one day get into medicine himself and clinch a Nobel prize.


Next, a few more stories from around the world:
  • Aldo and Sandro from Peru - founders of Dark Dome. They combine storytelling and art to make thrilling and chilling games, filled with plot twists and jump scares.

  • Vladimir, Tomislav and Boris from Croatia - founders of Pine Studio. They won the Indie Games Festival 2021 with their game Cats In Time. 

  • Kelly, Mikk, Reimo and Madde from Estonia - founders of ALPA kids. Their language games for children have a huge impact on early education and language preservation.

Check out all the stories now at g.co/play/weareplay and stay tuned for even more coming soon.


How useful did you find this blog post?


Announcing the new guide to Android app modularization

Posted by Miłosz Moczkowski, Developer Relations Engineer, Android

As your app grows in size and complexity, it becomes increasingly difficult to manage, build and scale. One way to address this challenge is a software technique called modular programming, or modularization in short. It’s a practice of organizing a codebase into loosely coupled and independent entities - modules.

We know that modularization has been a hot topic among the Android developers community for quite some time now. Recently, we ran a survey to ask you about your experiences in this topic. 86% of developers said that they work on multi-module codebases regularly, while over 90% stated that modularization is a practice they would recommend considering.

All large apps are fundamentally modular, and at Google, we’ve been utilizing modularization to develop our most popular applications such as YouTube, Play Store or Google News. This is what Google News team has to say about this practice:

“Modularity of code is critical to managing complexity, stability, readability, and testability in an ever-growing codebase.”

On the other hand though, over 54% responders mentioned that it’s difficult to find good learning materials on this topic and almost 95% claimed that currently available materials on developer.android.com are insufficient! In response to this popular demand, we’ve launched the guide to Android app modularization. The guide is split into two parts. The overview page gives you a high level, theoretical overview of the matter and addresses the following questions:
  • What is modularization?
  • What are the benefits of modularizing my codebase?
  • What are the things to watch out for when modularizing?
  • Is modularization the right technique for you?
The common modularization patterns page dives deep into practical examples in the context of the modern Android architecture and gives answer to the these problems:
  • What is the low coupling & high cohesion principle?
  • What are the types of modules and their roles?
  • How do modules pass data between each other?

To see modularization in action, check out the Now in Android project. It's a fully functional app which has a multi-module codebase, and there's a handy modularization learning journey which outlines what the modules do and how they communicate with each other.

Is this for you?


This modularization guide is targeted to intermediate and advanced developers. The guide focuses on modularization from a software architecture point of view. If you’re a beginner, only starting your Android developer journey, you should familiarize yourself with our guide to app architecture first. Modularization guide assumes you are familiar with our recommended app architecture.

It’s just a beginning


We’re not done yet. With modularization being such a wide topic, the two recently released pages are only a beginning. Help us shape the guidance by giving us feedback and telling us which issues you want us to cover. You can find us on social media or use the documentation issue tracker to report bugs.

Announcing the new guide to Android app modularization

Posted by Miłosz Moczkowski, Developer Relations Engineer, Android

As your app grows in size and complexity, it becomes increasingly difficult to manage, build and scale. One way to address this challenge is a software technique called modular programming, or modularization in short. It’s a practice of organizing a codebase into loosely coupled and independent entities - modules.

We know that modularization has been a hot topic among the Android developers community for quite some time now. Recently, we ran a survey to ask you about your experiences in this topic. 86% of developers said that they work on multi-module codebases regularly, while over 90% stated that modularization is a practice they would recommend considering.

All large apps are fundamentally modular, and at Google, we’ve been utilizing modularization to develop our most popular applications such as YouTube, Play Store or Google News. This is what Google News team has to say about this practice:

“Modularity of code is critical to managing complexity, stability, readability, and testability in an ever-growing codebase.”

On the other hand though, over 54% responders mentioned that it’s difficult to find good learning materials on this topic and almost 95% claimed that currently available materials on developer.android.com are insufficient! In response to this popular demand, we’ve launched the guide to Android app modularization. The guide is split into two parts. The overview page gives you a high level, theoretical overview of the matter and addresses the following questions:
  • What is modularization?
  • What are the benefits of modularizing my codebase?
  • What are the things to watch out for when modularizing?
  • Is modularization the right technique for you?
The common modularization patterns page dives deep into practical examples in the context of the modern Android architecture and gives answer to the these problems:
  • What is the low coupling & high cohesion principle?
  • What are the types of modules and their roles?
  • How do modules pass data between each other?

To see modularization in action, check out the Now in Android project. It's a fully functional app which has a multi-module codebase, and there's a handy modularization learning journey which outlines what the modules do and how they communicate with each other.

Is this for you?


This modularization guide is targeted to intermediate and advanced developers. The guide focuses on modularization from a software architecture point of view. If you’re a beginner, only starting your Android developer journey, you should familiarize yourself with our guide to app architecture first. Modularization guide assumes you are familiar with our recommended app architecture.

It’s just a beginning


We’re not done yet. With modularization being such a wide topic, the two recently released pages are only a beginning. Help us shape the guidance by giving us feedback and telling us which issues you want us to cover. You can find us on social media or use the documentation issue tracker to report bugs.

Announcing the new guide to Android app modularization

Posted by Miłosz Moczkowski, Developer Relations Engineer, Android

As your app grows in size and complexity, it becomes increasingly difficult to manage, build and scale. One way to address this challenge is a software technique called modular programming, or modularization in short. It’s a practice of organizing a codebase into loosely coupled and independent entities - modules.

We know that modularization has been a hot topic among the Android developers community for quite some time now. Recently, we ran a survey to ask you about your experiences in this topic. 86% of developers said that they work on multi-module codebases regularly, while over 90% stated that modularization is a practice they would recommend considering.

All large apps are fundamentally modular, and at Google, we’ve been utilizing modularization to develop our most popular applications such as YouTube, Play Store or Google News. This is what Google News team has to say about this practice:

“Modularity of code is critical to managing complexity, stability, readability, and testability in an ever-growing codebase.”

On the other hand though, over 54% responders mentioned that it’s difficult to find good learning materials on this topic and almost 95% claimed that currently available materials on developer.android.com are insufficient! In response to this popular demand, we’ve launched the guide to Android app modularization. The guide is split into two parts. The overview page gives you a high level, theoretical overview of the matter and addresses the following questions:
  • What is modularization?
  • What are the benefits of modularizing my codebase?
  • What are the things to watch out for when modularizing?
  • Is modularization the right technique for you?
The common modularization patterns page dives deep into practical examples in the context of the modern Android architecture and gives answer to the these problems:
  • What is the low coupling & high cohesion principle?
  • What are the types of modules and their roles?
  • How do modules pass data between each other?

To see modularization in action, check out the Now in Android project. It's a fully functional app which has a multi-module codebase, and there's a handy modularization learning journey which outlines what the modules do and how they communicate with each other.

Is this for you?


This modularization guide is targeted to intermediate and advanced developers. The guide focuses on modularization from a software architecture point of view. If you’re a beginner, only starting your Android developer journey, you should familiarize yourself with our guide to app architecture first. Modularization guide assumes you are familiar with our recommended app architecture.

It’s just a beginning


We’re not done yet. With modularization being such a wide topic, the two recently released pages are only a beginning. Help us shape the guidance by giving us feedback and telling us which issues you want us to cover. You can find us on social media or use the documentation issue tracker to report bugs.

Announcing the new guide to Android app modularization

Posted by Miłosz Moczkowski, Developer Relations Engineer, Android

As your app grows in size and complexity, it becomes increasingly difficult to manage, build and scale. One way to address this challenge is a software technique called modular programming, or modularization in short. It’s a practice of organizing a codebase into loosely coupled and independent entities - modules.

We know that modularization has been a hot topic among the Android developers community for quite some time now. Recently, we ran a survey to ask you about your experiences in this topic. 86% of developers said that they work on multi-module codebases regularly, while over 90% stated that modularization is a practice they would recommend considering.

All large apps are fundamentally modular, and at Google, we’ve been utilizing modularization to develop our most popular applications such as YouTube, Play Store or Google News. This is what Google News team has to say about this practice:

“Modularity of code is critical to managing complexity, stability, readability, and testability in an ever-growing codebase.”

On the other hand though, over 54% responders mentioned that it’s difficult to find good learning materials on this topic and almost 95% claimed that currently available materials on developer.android.com are insufficient! In response to this popular demand, we’ve launched the guide to Android app modularization. The guide is split into two parts. The overview page gives you a high level, theoretical overview of the matter and addresses the following questions:
  • What is modularization?
  • What are the benefits of modularizing my codebase?
  • What are the things to watch out for when modularizing?
  • Is modularization the right technique for you?
The common modularization patterns page dives deep into practical examples in the context of the modern Android architecture and gives answer to the these problems:
  • What is the low coupling & high cohesion principle?
  • What are the types of modules and their roles?
  • How do modules pass data between each other?

To see modularization in action, check out the Now in Android project. It's a fully functional app which has a multi-module codebase, and there's a handy modularization learning journey which outlines what the modules do and how they communicate with each other.

Is this for you?


This modularization guide is targeted to intermediate and advanced developers. The guide focuses on modularization from a software architecture point of view. If you’re a beginner, only starting your Android developer journey, you should familiarize yourself with our guide to app architecture first. Modularization guide assumes you are familiar with our recommended app architecture.

It’s just a beginning


We’re not done yet. With modularization being such a wide topic, the two recently released pages are only a beginning. Help us shape the guidance by giving us feedback and telling us which issues you want us to cover. You can find us on social media or use the documentation issue tracker to report bugs.

Announcing the new guide to Android app modularization

Posted by Miłosz Moczkowski, Developer Relations Engineer, Android

As your app grows in size and complexity, it becomes increasingly difficult to manage, build and scale. One way to address this challenge is a software technique called modular programming, or modularization in short. It’s a practice of organizing a codebase into loosely coupled and independent entities - modules.

We know that modularization has been a hot topic among the Android developers community for quite some time now. Recently, we ran a survey to ask you about your experiences in this topic. 86% of developers said that they work on multi-module codebases regularly, while over 90% stated that modularization is a practice they would recommend considering.

All large apps are fundamentally modular, and at Google, we’ve been utilizing modularization to develop our most popular applications such as YouTube, Play Store or Google News. This is what Google News team has to say about this practice:

“Modularity of code is critical to managing complexity, stability, readability, and testability in an ever-growing codebase.”

On the other hand though, over 54% responders mentioned that it’s difficult to find good learning materials on this topic and almost 95% claimed that currently available materials on developer.android.com are insufficient! In response to this popular demand, we’ve launched the guide to Android app modularization. The guide is split into two parts. The overview page gives you a high level, theoretical overview of the matter and addresses the following questions:
  • What is modularization?
  • What are the benefits of modularizing my codebase?
  • What are the things to watch out for when modularizing?
  • Is modularization the right technique for you?
The common modularization patterns page dives deep into practical examples in the context of the modern Android architecture and gives answer to the these problems:
  • What is the low coupling & high cohesion principle?
  • What are the types of modules and their roles?
  • How do modules pass data between each other?

To see modularization in action, check out the Now in Android project. It's a fully functional app which has a multi-module codebase, and there's a handy modularization learning journey which outlines what the modules do and how they communicate with each other.

Is this for you?


This modularization guide is targeted to intermediate and advanced developers. The guide focuses on modularization from a software architecture point of view. If you’re a beginner, only starting your Android developer journey, you should familiarize yourself with our guide to app architecture first. Modularization guide assumes you are familiar with our recommended app architecture.

It’s just a beginning


We’re not done yet. With modularization being such a wide topic, the two recently released pages are only a beginning. Help us shape the guidance by giving us feedback and telling us which issues you want us to cover. You can find us on social media or use the documentation issue tracker to report bugs.

Google Play announces the winners of the Indie Games Festival and the Accelerator class of 2022

Posted by Patricia Correa, Director, Global Developer Marketing

Today, at the finals of our Indie Games Festival, thousands of people came together to celebrate the passion, creativity and innovation of small games studios.

Players, jury members, and industry experts attended the event - hosted in a custom virtual world - where they discovered the finalist games and met the people who made them. They were also the first to find out who the winners are, who will receive prizes and promotions that will help them boost their visibility.

At the event we also announced the studios selected to join our Indie Games Accelerator. These companies will receive exclusive education and mentorship over a 10-week virtual program, to help them build and grow successful businesses.

Please join us in congratulating each of the winning games and studios.

Meet the festival winners

Europe

Dungeons of Dreadrock by Christoph Minnameier, from Germany
Please, Touch The Artwork by Thomas Waterzooi, from Belgium
Quadline by Ivan Kovalov, from Ukraine



South Korea

The Greater by IM GAME

Users' Choice Award:
Nyang Tower: Square Logic by Studio Box Cat

Japan

RASPBERRY MASH by IGNITION M
SOULVARS by ginolabo


Indie Games Accelerator | Class of 2022

Americas

Asantee Games - Brazil
Fiveamp Hawaii - US
MegaJogos - Brazil
Niebla Games - Chile
Northern Forge Studios - Canada
SHD Games Inc. - Canada
Skyborne Games Inc. - US
Solaris Mobile - Brazil
Starling Team - Brazil
Temple Gates Games - US
Asia Pacific

Drakemount - South Korea
Eternal Dream Studio - Indonesia
Gambir Studio - Indonesia
Hoit Studio - South Korea
Ranida Games - Philippines
Rigged Box Softworks - Indonesia
SweatyChair - Australia
The Sane Studio - South Korea
THEAND COMPANY - South Korea
Vnstart LLC - Vietnam
Europe, Middle East & Africa

Alcore Games - Ukraine
Appox AB - Sweden
Hammurabi Games - Turkiye
JE Software AB - Sweden
LoopyMood - Ukraine
PocApp Studios AB - Sweden
Rarepixels Indie Games - Spain
Rikzu Games - Portugal
Rojeh Maher - Egypt
Štěpán Fiala - Prague


Didn’t make it?

If you missed the event or would like to explore further, you can still log in to the virtual world and discover more about the finalists. Available for a limited time only. Explore now.

Stay tuned for more programs helping small games companies grow on Google Play.



How useful did you find this blog post?

Precise Improvements: How TikTok Enhanced its Video Social Experience on Android

Posted by The Android Developer Relations team

TL;DR


TikTok serves a wide range of user groups. With users around the world, it’s inevitable that some of them experience network issues such as slow, intermittent, or expensive connectivity. Other users are using entry level devices with limited memory and storage. Ensuring an excellent app experience in all these scenarios is paramount. TikTok's team was able to significantly improve their overall performance by following Android’s performance guidance, and employing their deep understanding of development tools such as Android Gradle Plugin and Jetpack libraries. If you want to learn how the TikTok team improved their app experience to achieve better business performance, please read our business article here.

Intro


TikTok is one of the most popular community-driven entertainment platforms with 1 billion people across the globe publishing and browsing video content every day.

A diverse user base naturally means diverse network bandwidth conditions and devices with different screen sizes, available memory and processing power. All users want a smooth, responsive app experience, no matter which device they use. If the app is slow to load, or playback gets stuck, users will feel frustrated and might abandon the app altogether. To avoid issues like these, the TikTok team continuously tracks the overall app performance through ongoing data monitoring, peer benchmarks, and user surveys.

TikTok is constantly introducing new features. But a rapid increase in functionality sometimes leads to an upsurge in technical requirements. The engineering team identified three reasons that slowed down the app : janky frames, video playback lag, and network issues. To solve these issues, the TikTok team looked to Android tools to start their app improvement journey.

From Discovery to Solution


Reducing app startup time, a smoother user experience with reduced jank and better video playback experience were three major goals that the team prioritized. They also discussed how to measure the effects of performance optimization to prevent the occurrence of regression.

1. Faster startup: refactor startup framework

App startup time is one of the metrics in Android Vitals. Making sure the app startup time is no longer than the Android Vital’s recommendation is the best way to ensure the app loads and starts responding to user activity as quickly as possible. The App Startup library is an Android Jetpack library to help developers initialize app components simply and efficiently.

The team studied the App Startup library in depth and refactored the app's startup framework to achieve on-demand loading and meticulous scheduling of components. In order to further reduce the execution time of creating Views on the main thread, the team even used a background thread to load View components asynchronously, thus improving the overall speed of app startup.

TikTok used Simpleperf to analyze the code execution time, and Android Studio's Profiler to monitor the usage of resources such as memory, CPU, and network to optimize I/O, threads, and resource locks.

2. Smoother user interface

To ensure a smoother user interface, the team needed to tackle two challenges: 1) simplify the View hierarchy, so that the app only renders what is necessary on screen, and 2) reduce the number of task executions in each frame so that the app can have a steady frame rate.

The TikTok team used the Layout Inspector in Android Studio to pinpoint the unnecessary layout contents. The layout boundaries of each View are clearly visible in the inspector, so the team can easily simplify the View hierarchy of the interface and reduce excessive and unnecessary content drawing.

In many cases, TikTok used doFrame() to perform frame-by-frame tasks. Trying to fit too much work in a single frame will inevitably cause a jank. TikTok's approach was to use allocation algorithms to distribute tasks into different frames to ensure that the application has a steady frame rate.

3. Better video playback experience: reuse resources

TikTok users can create audio and video content in various ways, and different codecs are used to play different types of content. Android provides the MediaCodec class to help access the underlying codec. To further improve the speed of video playback, it is good practice to provide different media player instances for different codecs. The TikTok team created a pool of media player instances throughout the application to neatly provide for various media contents. They even run each media player instance in different threads to minimize interference between one another

Network connection speed is another contributor to video lag . The team tested different solutions, including optimizing connections and reusing sockets, and developed algorithms to dynamically adjust buffer length when streaming content to reduce lag during playback.

They also used on-device video super-resolution to generate high-resolution frames based on low-resolution video content, further improving the quality of video playback without increasing network pressure.

Preloading (loading the next video ahead of time) and pre-rendering (rendering the first frame of the video ahead of time) are critical components to ensure that users have a smooth experience when playing multiple videos in succession. TikTok drew a Surface in advance only adding it into the screen when it is actually needed, to reduce the pressure of drawing it on the spot.

4. Avoid regressions

The team continues to maintain a detailed understanding of performance and works to fine-tune elements when necessary. Luckily, Android has tools in place for this exact purpose, like Systrace to capture traces so developers can export system activities (including CPU scheduling, disk activities, and app threads) for detailed analysis. The team also relies heavily on tools like Perfetto and Android Studio CPU profiler to track the execution time of various events, especially for I/O and class loading.

Better Performance, Better Experience


TikTok creatively leveraged the Android toolchain to track, quantify, and optimize their app’s performance for its business priorities, resulting in improved user experience and an increase in user satisfaction

The app startup time was reduced by 45%, and the smoothness (the chance of the frame rate being lower than the target value) has been optimized by 49%. When playing a video, the first frame of the video appeared 41% faster, and the chance of video lag was reduced by 27%.

Users are now more willing to use TikTok: active days per user in 30 days increased by 1%as did the average of session duration. User surveys and TikTok’s rating in Google Play also show a significant increase in user satisfaction.

The Next Stage for TikTok


By constantly optimizing app performance and adapting to the latest Android 13 platform, TikTok has created a more seamless app experience, encouraging more users to discover, create, and share the content they love.

With more than 250 million active large-screen Android devices globally, the team has also been focusing on large-screen devices, including foldable devices. By adopting the app to large screens, the team has brought a more immersive experience to TikTok users.

To learn more about how TikTok optimized its Android app to improve user experience and business performance, read the article here.

Get Guidance on Performance


To learn how you can get started to inspect, improve and monitor your app's performance visit our developer guide. The fastest way to improve your app's launch speed is by adding a baseline profile to your next release.