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?
-
For those unfamiliar with the subject, there's a list over here. Many are independent of cellular connection/service/etc. Also, it's not clear how many of these work with which phones or Android versions to begin with. A fair number of them don't work on my N5.– dotVezzDec 18, 2013 at 18:29
-
Too late to edit my comment, I realized that there's a better list on our own site: Do you know any other Android keypad commands (dialer codes)?– dotVezzDec 18, 2013 at 18:40
2 Answers
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.
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.