Android codebase easter eggs
Tags: android, mobile, resume
Published: 2023-01-16 07:17:44

> _(Image by the Olloweb agency on Unsplash)_

The Android codebase is full of surprises that we have yet to discover. 
Recently, I came across a presentation of the weird property [`DISALLOW_FUN`](https://developer.android.com/reference/android/os/UserManager#DISALLOW_FUN.
) in the UserManager, and it made me want to look for the other easter eggs, pranks and small jokes hidden in the Android codebase.
Without further ado ! 


![Interrogation Gif](https://media.giphy.com/media/SGujC3SmOI5Vu/giphy.gif)

### Android easter eggs
The first thing that should come to mind when speaking of easter eggs in Android, is the one that can be found for every Android Version since 2.3 
Easily accessible to even non-developers, just go to `Settings` -> `About Phone` -> Repeatedly tap on the Android version 
[Find all the version easters eggs here](https://www.androidauthority.com/android-easter-eggs-818694/
)

### UserManager

In the code, the UserManager is probably the go-to place to hide curiosities. 

Might your users be subject to teleportation ? I have something for you !  [`isUserAGoat()`](https://developer.android.com/reference/android/os/UserManager#isUserAGoat())

![isUserAGoat()](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdgswcyd92xhleh81kqh.png)

Unleash the power of your code with Android's advanced goat recognition technology and please, respect the goat's privacy.

And who says that the goats cannot have fun?

You'll be able to control the fun of your user with [`DISALLOW_FUN`](https://developer.android.com/reference/android/os/UserManager#DISALLOW_FUN.) 


![Screenshot of the android codebase for DISALLOW_FUN](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1tirt9bet4wz8n5rbp82.png)

As we can see, the fun is disabled for our users by default. I invite Android Developers to repair this mischief and turn on the fun for all your users. 
It is our responsibility to make the world a better place. 


### Ready for space
If you could not make the world a better place with DISALLOW_FUN, time to build a Death Star ! 
Luckily Android can help us by providing the expected gravity of the Death Star. 
Use the Sensor Manager and use the [`GRAVITY_DEATH_STAR_I`](https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_DEATH_STAR_I)
Seems important as they added it in the very first API...

### WTF 
Are you having a long day ? Have you been scratching your head for too long about weird behaviors ? 
Just release pressure and place some WTF on your code : 
[`Log.wtf()`](https://developer.android.com/reference/android/util/Log#wtf(java.lang.String,%20java.lang.String))
WTF -> "What a terrible Failure"


### The jazzman 
You app will be used by very agile users and you need to handle multiple clicks at the same time, [`FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND`](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND) is for you ! 
Nice touch, Android ;) 

### Cats and developers
What would be the internet and by extension the developers without cats?! 
I found >200 files containing meow in the source of android. -> https://cs.android.com/search?q=Meow 


### The final countdown


What better way to close this article than the final countdown?! 
Using [`Chronometer(context).isTheFinalCountDown()`](https://developer.android.com/reference/android/widget/Chronometer#isTheFinalCountDown()) will launch youtube and play... The final countdown !

![Final countdown codebase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/532t9ejo0347chj6m4nf.png)





Sources :
Android source code explorer 
https://cs.android.com

`The final countdown`
https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/widget/Chronometer.java;l=163;bpv=1;bpt=1?q=finalcountdown

Most of the inspiration come from this article 
https://blog.danlew.net/2015/04/18/is-your-user-a-goat/