3

Dialer secret codes are fun and useful and all the rage, but how can I use them in my tablet, or my TV dongle, or any onther non-phone android device?

Mindwin Remember Monica
  • 1,133
  • 6
  • 14
  • 27

2 Answers2

5

From adb shell:

am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://<secretcode>

Where <secretcode> is the code without the asterisks, e.g., 4636.

This is more effective than the DIAL action because it's direct and does not rely on the dialer to parse the code and fire the secret code intent itself. (Some dialers will not do this automatically and you'd have to hit "Call".) The DIAL intent is also handled by multiple apps (Phone, Skype, and Hangouts Dialer on my device) so this can skip that annoyance.

Matthew Read
  • 50,567
  • 30
  • 145
  • 273
3

There are at least three ways of doing it.

Programmatically by starting an Activity with Intent.ACTION_DIAL:

String secretCode = "123456789";
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:*#*#" + secretCode + "#*#*"));
startActivity(intent);

Programmatically by broadcasting an Intent:

String secretCode = "123456789";
String action = "android.provider.Telephony.SECRET_CODE";
Uri uri = Uri.parse("android_secret_code://" + secretCode);
Intent intent = new Intent(action, uri);
sendBroadcast(intent);

With a third party app:

I developed an open source app that crawls AndroidManifest.xml files on your device to find secret codes, and allows you to execute the secret codes available on your device.
You can get it on the Play Store or on the GitHub repository Android-Secret Codes.

Matthew Read
  • 50,567
  • 30
  • 145
  • 273
Simon Marquis
  • 231
  • 1
  • 5