Home > Tricks & Tips > Launch your applications on custom secret code

Launch your applications on custom secret code

You might know about some of Android Secret Number or Code, right?

For sample, on the dial pad, type this code: *#*#4636#*#*, the a Testing screen will appear; it’s a secret screen that you do/don’t know about it before.

Dial Pad on SecretCode

Dial Pad on SecretCode

The interesting point here is that you absolutely want to do the same thing, type your custom secret code and your app is launched immediately.

This is what you need to do for it.

1. Create a custom BroadcastReceiver for Secret Code entering; for sample, I named it MySecretCodeReceiver.

This receiver will launch my Activity on detection.

public class MySecretCodeReceiver extends BroadcastReceiver {

	public void onReceive(Context context, Intent intent) {
		if(intent.getAction().equals("android.provider.Telephony.SECRET_CODE")) {
			Intent i = new Intent(context, MainActivity.class);


2. Register the MySecretCodeReceiver properly, like below:

        <receiver android:name=".MySecretCodeReceiver">
          		<action android:name="android.provider.Telephony.SECRET_CODE" />
         		<data android:scheme="android_secret_code" android:host="1711" />

You need to make sure that the tag <action> should be like exactly same as above, since it’s the pre-defined action for SECRET_CODE handling. Also, pick a number in attribute “android:host” to your application. For sample here, I pick my lucky number 1711.

That’s pretty much straightforward. Have fun anyway!


Pete Houston

Categories: Tricks & Tips Tags: , , ,
  1. Paulo Teixeira
    August 27, 2013 at 12:56 am

    Hi. I tried to apply this code but it seems that custom codes are filtered out as nothing happens, but if I use an existing one, lets say 4636, then it works. Am I missing something, I even tried using your lucky number (hehe), assuming if it worked for you it woul work for me, but nothing.

    • NorthernPaladin
      October 15, 2014 at 3:43 am

      I’ve noticed this on the Galaxy S4 in particular. Did you ever find a solution? There must be a list of numbers somewhere and perhaps it can be edited.

  2. redbulletnl
    August 15, 2012 at 4:34 pm

    why would you dial your app instead create shortcut?

    • January 31, 2013 at 2:59 am

      In situations like SuperUser, you can hide the app or lock it with the pro version and the only way into the application is to dial a code you setup.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: