What exactly happens when I install an android application?

前端 未结 3 801
礼貌的吻别
礼貌的吻别 2020-12-28 16:19

My guess is that the contents of .apk package are extracted somewhere, and the application is registered at some directory so that the application launcher or whatever can f

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-28 16:42

    Android defines an intent as "an abstract description of an operation to be performed." Not only do intents let you use activities made by others, but they are also used to launch applications. I'm sure you've seen these lines in every app you've written:

    
      
      
    
    

    This intent filter allows the launcher to find the starting activity of each app. Lookup "intent resolution" for more details on this process... I'd say it's more elegant than simply registering the application at some random directory.

    As stated in, http://developer.android.com/guide/topics/intents/intents-filters.html, "Android system populates the application launcher, the top-level screen that shows the applications that are available for the user to launch, by finding all the activities with intent filters that specify the "android.intent.action.MAIN" action and "android.intent.category.LAUNCHER" category. It then displays the icons and labels of those activities in the launcher"

提交回复
热议问题