Rendering

A key aspect of your app that influences your users’ perception of quality is the smoothness with which it renders images and text to the screen. It is important to avoid jank and sluggish responsiveness when your app is drawing to the screen.
There are several ways to optimize your app’s rendering performance: reducing overdraw, optimizing view hierarchies, and taking advantage of the Profile GPU tool.

Read More »

Memory leaks

Every app needs memory as a resource to do its work. To make sure each app in Android has enough memory, Android system needs to manage memory allocation efficiently. Android runtime triggers Garbage Collection (GC) when memory runs short. The purpose of GC is to reclaim memory by cleaning up objects that are no longer useful. It achieves it in three steps.

  1. Traverses all object references in memory from GC roots and marks active objects which has references from GC roots.
  2. All objects which are not marked (garbages) are wiped from memory.
  3. Rearrange live objects
Read More »

PdfRenderer API

This class enables rendering a PDF document. This class is not thread safe.
This api is added in API level 21

If you want to render a PDF, you create a renderer and for every page you want to render, you open the page, render it, and close the page. After you are done with rendering, you close the renderer. After the renderer is closed it should not be used anymore. Note that the pages are rendered one by one, i.e. you can have only a single page opened at any given time.

Read More »

Memory Profiler

The Memory Profiler is a component in the Android Profiler that helps you identify memory leaks and memory churn that can lead to stutter, freezes, and even app crashes. It shows a real-time graph of your app’s memory use and lets you capture a heap dump, force garbage collections, and track memory allocations.
To open the Memory Profiler, follow these steps:

  1. Click View > Tool Windows > Profiler (you can also click Profile in the toolbar).
  2. Select the device and app process you want to profile from the Android Profiler toolbar. If you’ve connected a device over USB but don’t see it listed, ensure that you have enabled USB debugging.
  3. Click anywhere in the MEMORY timeline to open the Memory Profiler.
Read More »

Monkey Test

The Monkey is a program that runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.

Read More »