Android Secret Code

Source: Internet
Author: User

Many of us should have done this, open the dial pad input *#* #4636 #*#* and other characters will pop up an interface to display some information about the phone, this feature is called Android secret code in Android, in addition to these system presets secret Code, we can also implement our own secret code, and the implementation is very simple.

To implement your own secret code, simply register a broadcast Receiver with the system and do not require any permissions, as follows:

<receiver android:name= ". Secretreceiver ">    <intent-filter>        <action android:name=" android.provider.Telephony.SECRET_ CODE "/>        <data android:scheme=" Android_secret_code "android:host=" 0123 "/>    </intent-filter> </receiver>
only need to register action as Android.provider.Telephony.SECRET_CODE, and scheme is Android_secret_code broadcast Receiver, This will call our registered receiver when the user enters *#* #0123 #*#* on the dial pad, and the received intent message will be typed in receiver:
Intent {act=android.provider.telephony.secret_code dat=android_secret_code://0123 flg=0x10 cmp= me.angeldevil.secretcode/. Secretreceiver}
This logic is handled in a dial-up application, and if a third-party dialing application is used and the application is not processed, it may fail.

So what's the use of this feature? This depends on the application, as this broadcast receiver runs within your own application process, so you can read all the data in your app. For example, you can receive the broadcast after the dump application status, you can open an activity to do some special settings, you can enable/disable some functions (such as flyme can be input *#* #6961 #*#* after the settings to display some of the accessibility features, Can be turned on root, etc.).

However, different receiver can register the same android:host, may conflict with other application settings, but generally the application should not use this function, non-system-level application control or put in the application is better.

Android Secret Code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.