On many Android devices you can get into a secret settings menu from Phone app by typing in
*#*#4636#*#*
http://technology-headlines.com/2010/09/17/4636-and
looking for this
Intent intent = new Intent("android.intent.action.MAIN");
intent.setClassName("com.android.settings", "com.android.settings.Settings$TestingSettingsActivity");
startActivity(intent);
try this
String ussdCode = "*" +Uri.encode ("#")+"*"+Uri.encode ("#")+ "4636" + Uri.encode ("#")+"*"+Uri.encode ("#")+"*";
startActivity (new Intent ("android.intent.action.CALL", Uri.parse ("tel:" + ussdCode)));
finally you must encode '#' using Uri.encode()
ACTION_DIAL
sends the user to the dialer with the given code (it does not call). So that would be :
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:*#*#4636#*#*"));
startActivity(intent);
It would appear that codes are to be dialed, rather than to be called
Is it also possible to open this stuff programmatically?
Yes:
Intent in = new Intent(Intent.ACTION_MAIN);
in.setClassName("com.android.settings", "com.android.settings.TestingSettings");
startActivity(in);
You just need to watch logcat output to learn what this magic combination actually opens:
I/ActivityManager(31362): START {act=android.intent.action.MAIN flg=0x10000000 cmp=com.android.settings/.TestingSettings} from pid 4257
Secret codes exist and work independent of the dialer application. The dialer application just provides a handy interface for these codes. It recognizes the special string and then calls a special intent to invoke the action. You shouldn't use the dialer to call these dialogs. Instead you can call the secret codes directly yourself like the dialer does internally:
Invoking built in secret codes:
What the dialer really does when you enter the code is extracting the number between *#*# and #*#* and then broadcasting the following intent:
sendBroadcast(new Intent("android.provider.Telephony.SECRET_CODE", Uri.parse("android_secret_code://4636")));
Register your own secret codes (if you like):
You can even register your own secret code actions using:
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data android:scheme="android_secret_code" android:host="4636" />
Source: http://android.amberfog.com/?p=422
Edit: Fixed a bug in the original code (see comment)