Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically enter secret code like *#*#4636#*#* on Android

Tags:

android

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-android-secret-codes/

There are also some other codes.

Is it also possible to open this stuff programmatically?

I've tried this:

Intent intent = new Intent(Intent.ACTION_CALL);    
intent.setData(Uri.parse("tel:*#*#4636#*#*"));
startActivity(intent);

But it just tries to initiate a phone call and of course fails, hangs up and closes the Phone app.

EDIT: The phone *#*#4636#*#* gets saved to my Contact list as "Unknown" but the call just fails. In fact, the secret code only works when you type manually on buttons in Phone app without pressing Call in the end. Is it probably just a hidden feature of Phone app which has nothing to do with calling? If so, one could open the Phone app programmatically and simulate typing on the buttons.

According to this post Programmatically press a button in another appplication's activity

this should NOT be possible because if any app on non-rooted phone could just start other apps and press something there, it could take over control of the whole device and do bad things.

Here are some more details but I guess the post is a bit old and even if it worked it may have been changed in current Android versions: http://mylifewithandroid.blogspot.de/2009/01/generating-keypresses-programmatically.html

So, no easier way to enter secret code?

like image 767
iseeall Avatar asked Mar 19 '12 11:03

iseeall


People also ask

What is the use of * * 4636 * *?

Android code: *#*#4636#*#* This code will open up a menu that shows information about your phone's data usages. Here's how you can retrieve deleted text messages on your iPhone.

How do you use secret codes?

How to execute a secret code? There are two ways to execute a secret code: Directly through the dialer application of your Android device. Simply write the secret code like: *#*#123456789#*#* .

What is a secret code?

Noun. 1. secret code - a secret method of writing. cryptograph, cypher, cipher. code - a coding system used for transmitting messages requiring brevity or secrecy.


1 Answers

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

like image 135
Pointer Null Avatar answered Sep 22 '22 16:09

Pointer Null