Android Developer Toolbox – Notes

Android Developer Toolbox – Notes

Gradle

  • Create different build variants which contain different code of your app
    • Internal – for the company. Embed a lot of tools to locate issues easily.
    • Production – only for customers

U+2020 application

A demonstration of integration of different libraries. Read the source code.

IOSched app

The iosched app contains a separate debug screen which is visible only in the internal build.

Example app

Check the mobilization-2016 app for more details.

Measuring tools

Android Monitor tab

Use the monitor tab built in the Android Studio to track different measurements of your app – Cache, network, CPU, GPU etc.

Android Studio Memory Leak Detection

Use the memory profiler to track memory leaks by making HRPOF dumps.

LeakCanary

Detect memory leaks which happen in your app.

Takt

See what is the frame rate of your app.

Hugo

Log how much time your methods execution take by using annotations.

Pidcat

Use Pidcat to print the logs of your app. Easy to install and good design.

AndroidDevMetrics

Track the time needed for dependencies to be provided using Dagger.

Code static analysis tools

Lint

SonarLint

More focused on the Java code than Android Lint.

SonarQube

Continuous integration server. Tells you things like technical debt in days, count of code smells, tests coverage etc.

Error Prone (Google)

Infer (Facebook)

Testing tools

Mock the server

NodeJS + Express

MockServer

Use to return fake HTTP responses so testing can easily be done.

Hosts Editor

Associate a domain name to a different IP.

HTTP Debugging

mitmproxy

Fiddler

Charles Proxy

Has debugging options with the option to replace values directly into the received response. Works great with Android. You can also simulate slow connection and repeat queries.

Android State Restoring

Don’t keep activities

Option in the Developer options.

Fill Ram

Fills the RAM of your phone and the system begins clearing the available apps and later restores them. It is a good tool for QAs.

Android Device Monitor – Stop Process

You can minimize your app by clicking the home button and the stop the process from the device monitor. Then the system will recreate the activities.

Analyzing tools

Developer Options

Show layout bounds

See layout positions and marign

Debug GPU overdraw

Check the view hierarchy you have and optimize it.

Animation Scale

Slow the animations in your app

Screencast + VLC

Make a screencast, open VLC and use the letter “E” to view the transition frame per frame.

UIAutomatorViewer

Browse directly the view hieararchy and pick views by ids.

APKTool + Dex2Jar + JD-GUI

Decompile APK and check its source code.

JADX

Android Studio – Build > Analyze APK

Favorite tools

Stetho

Connect the phone to the PC and check the view hierarchy on the Chrome browser.

Stetho – Network

Check the requests that happen and the responses received.

Stetho Dumpapp

Communicate with your app through terminal. You can display the content of the received response, the alarm manager scheduled intents etc.

You may also like...