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

Multi Thread and Performance Tools

Tips #1 Multi Thread

Choose the right Thread :

  • 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:

  • 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

Firebase Performance

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)

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..