Android Performance Checking and Solving(3): Tips No Tricks

Multi Thread and Performance Tools

Tips #1 Multi Thread

Choose the right Thread :

  • IO Thread -> IO Process, Read/Write Disk and Network Process
  • Computation Thread ->For complex algorithm, calculation, or long process
  • Main Thread -> Leave it for UI Showing or Changes.

Choose the right Api for changing Thread:

  • Runnable -> simple changing Thread for leave and forget process.
Thread(Runnable{player.release()}).start()
  • AsyncTask -> simple changing Thread and back to UI Thread.
  • RXJava -> changing Thread multiple times in 1 process call.

Android has provided some good tips regarding performance, you can take a look at this. This story has some different tips other than Android has provided.

Tips #2 Tools

Just like some super heroes have weapon. We need some weapons or tools to help us kill performance issues.

Firebase Performance

This tools is very use full. You can trace Network, CPU, App Start Duration, Slow Rendering and many more.

The data is huge. Because the data got from real users. More Number of user you have, more data you got.

Android Studio Profiler (CPU Profiler)

I like the CPU Profiler, because i can measure the duration of some methods call. And i can trace the longest methods call that disturb UI Thread.

And if you want to automatically do profiling while your app is running without attach to Android Studio Profiler you can use Debug APi. Record automatically and simply export the result to Android Studio Profiler.

--

--

--

Still believe, can change the world with code..

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Android-Pentesting- Android Appsec (Kotlin) Bypassing security checks

How to update your Android app, when you have lost app signing key?

Reverse control power-up

Automating analyzing of code in Android projects

Accommodate your project-specific needs with custom templates

How to Use hCaptcha with Android Apps

Automating your Firebase App Distribution flow — Android

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ade sueb

ade sueb

Still believe, can change the world with code..

More from Medium

How to Display item names on spinner but select IDs only.

How to Observe Network Connection Status

What is Kotlin and Why you should use it?

More ways to add parallax to your lists