Skip to main content

Command Palette

Search for a command to run...

How to be an Android Developer with just 7 taps. Deep Dive šŸ”Ž

Updated
•3 min read
How to be an Android Developer with just 7 taps. Deep Dive šŸ”Ž

DISCLAIMER: This is a non-technical just-for-fun post!

In the past few years, the Android ecosystem has exploded with lots of tools, libraries, and architecture guidelines. Recently, with I/O 2017 announcement of Kotlin support, it just added another dimension.

Today, I am going to show you quickest way of becoming an Android Developer regardless of language and plethora of libraries, all you need is a physical Android device.

Becoming Android developer

On your device, go to Settings > About and find ā€œBuild Numberā€

p.s. The ā€œBuild Numberā€ may be burried under additional sub section based on device manufacturer like LG, Samsung, HTC and so on. You just need to find it šŸ¤“.

Now, all you need to do is keep tapping the build number value until it says you have become a developer. And that’s it!

Here is how I became a developer using my Pixel 2 XL device:

A short clip showcasing how to enable ā€˜Developer options’

If you made this far, you know this is a joke šŸ™ˆ! By now, every Android devs know how to activate the developer options on any Android device.

However, back in the days, there was no tapping required to activate it, it was always there. So, when they added this feature, I’ll be honest, I did have to Google for it 😁.

Under the hood

As I was curious, I wanted to see how the logic works in the Android settings screen. I found that all these logic of activating the developer options is in BuildNumberPreferenceController.java (AOSP) source code.

First, the most important constant that defines how many times we have to tap to become the ā€˜developer’ is:

static final int TAPS_TO_BE_A_DEVELOPER = 7;

Why 7? Maybe because it’s considered a lucky number? ĀÆ\_(惄)_/ĀÆ

Pre-conditions

Here some of the pre-conditions that have to be met before developer settings can be activated by tapping 7 times on the build number.

  • Admin user of the device (using UserManager)
  • Device Provisioning is complete
  • Tapping is not done by monkey-runner
  • Debugging feature is not disabled by Device Owner/Work Profile

After these requirements are met, all there is left to do is count-down the number of taps. Here is a simplified code snapshot with some added inline comments:

if (mDevHitCountdown > 0) {
mDevHitCountdown--;
if (mDevHitCountdown == 0 && !mProcessingLastDevHit) {
// Open the lock screen validation screen before activating
mProcessingLastDevHit = helper.launchConfirmationActivity();
if (!mProcessingLastDevHit) {
// Activates developer settings after lock verification
enableDevelopmentSettings();
}
} else if (mDevHitCountdown > 0
&& mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER - 2)) {

// Show - "You are X taps away from being developer."
mDevHitToast = Toast.makeText(getQuantityString(
R.plurals.show_dev_countdown,
mDevHitCountdown,
mDevHitCountdown),
Toast.LENGTH_SHORT);
mDevHitToast.show();
}
} else if (mDevHitCountdown < 0) {
// This means, you have already tapped 7 times, you're a DEV!
mDevHitToast = Toast.makeText(R.string.show_dev_already,
Toast.LENGTH_LONG);
mDevHitToast.show();
}

That’s it, mystery solved šŸŽ‰