title: Programmatically enter secret code like *#*#4636#*#* on Android
body: <p>On many Android devices you can get into a secret settings menu from Phone app by typing in </p>
  
  <p>*#*#4636#*#*</p>
  
  <p><a href="http://technology-headlines.com/2010/09/17/4636-android-secret-codes/" rel="nofollow noreferrer">http://technology-headlines.com/2010/09/17/4636-android-secret-codes/</a></p>
  
  <p>There are also some other codes.</p>
  
  <p>Is it also possible to open this stuff programmatically?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_CALL);    
  intent.setData(Uri.parse("tel:*#*#4636#*#*"));
  startActivity(intent);
  </code></pre>
  
  <p>But it just tries to initiate a phone call and of course fails, hangs up and closes the Phone app.</p>
  
  <p>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. </p>
  
  <p>According to this post
  <a href="https://stackoverflow.com/questions/6954711/programmatically-press-a-button-in-another-appplications-activity">Programmatically press a button in another appplication&#39;s activity</a></p>
  
  <p>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.</p>
  
  <p>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:
  <a href="http://mylifewithandroid.blogspot.de/2009/01/generating-keypresses-programmatically.html" rel="nofollow noreferrer">http://mylifewithandroid.blogspot.de/2009/01/generating-keypresses-programmatically.html</a></p>
  
  <p>So, no easier way to enter secret code?</p>