Secret codes

Android has a neat place to hide debug screens. You can register a receiver for SECRET_CODE broadcasts sent via the dialler. This can be a good place to put feature switches or diagnostic info.

Some of these are built into the platform. Try dialling: *#*#4636#*#*.

With these snippets, dialling *#*#1111#*#* will launch the SecretActivity. FLAG_ACTIVITY_NEW_TASK is required because we don’t have an Activity context for the startActivity() call.

Note: The use of the secret code is clearly visible in the AndroidManifest.xml, so it’s a bad idea to put anything sensitive behind this in a release build.