Detailed description of how Android starts a Java program APPLICATION

Source: Internet
Author: User

Android, as a Linux-based mobile phone operating system, has the greatest support for various applications. This is also a concern for developers. Here we will give you a detailed introduction of the specific application skills for Android to start Java programs, so that you can easily interpret the functions of this operating system.

First, go to shell

 
 
  1. C:\Documents and Settings\mawenjian>adb shell 

Let's take a look at the help of the command.

 
 
  1. # am -help   
  2. am -help   
  3. Error: Unknown command: -help   
  4. usage: am [start|instrument]   
  5. am start [-a < ACTION>] [-d < DATA_URI>] 
    [-t < MIME_TYPE>]   
  6. [-c < CATEGORY> [-c < CATEGORY>] ...]   
  7. [-e < EXTRA_KEY> < EXTRA_VALUE> 
    [-e < EXTRA_KEY> < EXTRA_VALUE> ...]   
  8. [-n < COMPONENT>] [-D] [< URI>]   
  9. am instrument [-e < ARG_NAME> < ARG_VALUE>] 
    [-p < PROF_FILE>]   
  10. [-w] < COMPONENT> 

Okay. Try to start the browser.

 
 
  1. # am start -n com.google.android.browser/
    com.google.android.browser.BrowserActivity   
  2. am start -n com.google.android.browser/com.google.
    android.browser.BrowserActivity   
  3. Starting: Intent { comp={com.google.android.browser/
    com.google.android.browser.BrowserActivity} } 

OK.

Try the following command:

 
 
  1. # am start -a android.intent.action.VIEW -d 
    http://mwjian.javaeye.com   
  2. am start -a android.intent.action.VIEW -d 
    http://mwjian.javaeye.com   
  3. Starting: Intent { action=android.intent.action.VIEW 
    data=http://mwjian.javaeye.com }   
  4. # am start -a android.intent.action.CALL -d tel:88888888   
  5. am start -a android.intent.action.CALL -d tel:88888888   
  6. Starting: Intent { action=android.intent.action.CALL 
    data=tel:88888888 }   
  7. # am start -a android.intent.action.ALL_APPS   
  8. am start -a android.intent.action.ALL_APPS   
  9. Starting: Intent { action=android.intent.action.ALL_APPS }   
  10. # am start -a android.intent.action.VIEW geo:0,0?q=shanghai   
  11. am start -a android.intent.action.VIEW geo:0,0?q=shanghai   
  12. Starting: Intent { action=android.intent.action.VIEW 
    data=geo:0,0?q=shanghai } 

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.