Android third party tools to increase the performance of your app.
In our android apps it’s not always easy to find performance issues, that’s why we have to use some tools to help us find them. In this article I’d like to tell you about some third party libraries that try to make android developers’ life easier.
First of all, I’ll say, that I won’t speak here about all the built in tools that can help you with that like android studio tools (profiler, systrace, etc.) developer options. I highly recommend you to read about them if you haven’t done that already.
I tried to make a small review of each tool that I found on the Internet that helps with performance issues and is still actual today. I’d be happy if you can mention any other tool that I missed.
A very popular and must-have tool to catch memory leaks in your application. It’s actively supported and there is going to be v2 release soon. I won’t talk about it too much, since I guess you’ve already worked with it, if not then go and try it yourself. Github.
Android Performance Monitor (Block Canary)
A transparent ui-block detection library, also known as BlockCanary (to pay respect to the LeakCanary lib). UX flow is also similar to LeakCanary: whenever the library finds a UI block longer than time interval you specified, it will inform you with notification and show you detailed information about the block.
There are a lot of params to configure (like block threshold, logging, whitelist, adding your own interceptors). And after that you can start using the library. Github Unfortunately, you won’t be able to start working with the original library instantly on the latest versions of Android. It is not actively supported now, the latest commit in repo is 2 years old at the moment of writing the post. But you can fork it and fix bugs or use other guys’ forks with fixed issues (like I did 🙂 ). I used a fork of 1951FDG. To add it to your project use this line.
Another usefull library with which you’ll be able to see how performant are Activity lifecycle methods (onCreate(), onStart(), onResume()), info about dropped frames and even time it takes Dagger to initialize objects in a dependency graph (if you use Dagger 2 in you project)
It’s just a small tool that can show you a small text with your device’s current fps. Takt uses Choreographer under the hood. Really easy to add and very usefull. Github
Studio CPU profiler is a great tool to trace methods, but sometimes it’s not enough. As Uber guys say “After running into limitations of the Android Studio CPU profiler, we built Nanoscope, an internal tool to provide us with better method tracing.”
To achieve this performance, the interesting pieces of Nanoscope are implemented as a fork of AOSP. For this reason, you’ll need to use the Nanoscope Emulator or a device running the Nanoscope OS in order to make use of this tool. Check out the github repo for more info. Github
Android God Eye
Android developer lack of monitoring of performance data,especially in production environment. so we need “AndroidGodEye”.
Well, that’s a name you won’t forget. This is a performance monitor tool, where you can easily monitor the performance of your app in real time in pc browser. I’ve only tested it on the demo app, but it has already impressed me. It shows Fps/RAM/PSS/Battery, Cpu/Heap/Traffic, Leak Memory/App Janks, Network and Thread details etc.
One little problem I see here that it’s library from Chinese guys. So you can see some issues on the repo with discussions in Chinese. But entire Readme file and app performance results come in both English and Chinese. Definetely worth a try. Github
Another powerfull tool from Chinese guys. As they say:
Booster provides a collection of modules for performance detection, multithreading optimization, resources index inline, redundant resources reduction, resources compression, system bug fixing, etc. Using booster, the stability of application can be increased by 15% ~ 25%, and the package size can be reduced by 1MB ~ 10MB.
It has around 20 small modules that you can integrate independently. Some of them are very interesting, like finding calling blocking API on the main thread, issues with WebView, SharedPreferences etc. Github
Profilo is a new facebook’s tool for collecting performance traces from production builds of an app. Is under active development as I can see.
Originally published at https://andrey-kazarovets.com on August 30, 2019.