Recently, wrote a small application of information about equipment, requirements in the launcher is not obvious, through the dial-up keyboard cipher to start the application. The following notes are available:
Software platform: Android4.4.3
First, you want to register to receive Android cipher broadcasts in Androidmanifest.xml.
<span style= "FONT-SIZE:18PX;" ><receiver android:name= "Infosecretcode" > <intent-filter> <action android:name= " Android.provider.Telephony.SECRET_CODE "/> <data android:host=" 668866 " android:scheme=" Android_secret_code "/> </intent-filter> </receiver></span>
Secondly, we need to instantiate the processing of the received broadcast event, named Infosecretcode.java, the code is as follows:
<span style= "FONT-SIZE:18PX;" >import Android.content.context;import Android.content.intent;import Android.content.broadcastreceiver;import Android.util.config;import Android.util.log;import Android.view.keyevent;public class InfoSecretCode extends Broadcastreceiver { private final String secret_code_action = "Android.provider.Telephony.SECRET_CODE"; Public Infosecretcode () { } @Override the public void onreceive (context context, Intent Intent) { if ( Intent.getaction (). Equals (Secret_code_action)) { Intent i = new intent (intent.action_main); I.setclass (context, infoactivity.class); I.setflags (intent.flag_activity_new_task); Context.startactivity (i);}} } </span>
so, in the dial-up keyboard input "*#* #668866 #*#*" can pop up infoactivity, specific activity to add themselves.
Android dial cipher to start the app