android launcher-啟動過程

來源:互聯網
上載者:User

標籤:

 Launcher的啟動過程

參考:http://blog.csdn.net/fengkehuan/article/details/6205980

從網路上找了一段關於Launcher的啟動過程的文章,作為學習Launcher的背景知識:

Linux kernel啟動以後會通過app_main進程來初始化android Runtime Java運行環境,而zygote是Android的第一個進程。所有的android的應用以及大部分系統服務都是通過zygote fork出來的子進程(我現在看到的只有native的service manager不是zygote fork出來的)。在system server中啟動的若干系統服務中與我們啟動進程相關的就是Acitivity Manager。
  當systerm server啟動好所有服務以後,系統就進入”system ready”狀態,這個時候Activity Manager就登場了。Activity Manager光看程式碼就知道是一個重量級的服務,它主要管理Activity之間的跳轉,以及進程的生命週期。當Activity Manager發現系統已經啟動好以後它就會發出一個intent:

  Intent intent = new Intent(mTopAction, mTopData != null ? Uri.parse(mTopData) : null);  intent.setComponent(mTopComponent);  if (mFactoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) {      intent.addCategory(Intent.CATEGORY_HOME);  }
......

  startActivityLocked(null, intent, null, null, 0, aInfo,null, null, 0, 0, 0, false, false);

home manifest

  <intent-filter>  <action android:name="android.intent.action.MAIN" />  <category android:name="android.intent.category.HOME"/>  <category android:name="android.intent.category.DEFAULT" />  </intent-filter>

啟動Home進程了。而這個啟動Home進程的過程實際上還是去通過zygote fork出的一個子進程。

 

 

 

 

 

 

 

 

  

android launcher-啟動過程

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.