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?
am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://<secretcode>
<secretcode> is the code without the asterisks, e.g.,
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.
There are at least three ways of doing it.
Programmatically by starting an Activity with
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.