最終更新:2016-09-29 (木) 23:16:22 (2764d)  

Android/プロセス
Top / Android / プロセス

By default, all components of the same application run in the same process and most applications should not change this.

http://developer.android.com/guide/components/processes-and-threads.html

メモ

  • プロセスごとにVMが動作

importance hierarchy

  • To determine which processes to keep and which to kill, the system places each process into an "importance hierarchy" based on the components running in the process and the state of those components.
  • There are five levels in the importance hierarchy.
  • Foreground process
  • Visible process
  • Service process
  • Background process
  • Empty process

AndroidManifest.xml

android:process

  • http://www.techdoctranslator.com/android/guide/manifest/application-element
  • アプリケーションのすべてのコンポーネントが実行されているべきプロセスの名前です。各コンポーネントはこのデフォルトの設定を個別の process 属性で上書き可能です。 デフォルトでは、Android は、そのコンポーネントの実行が初めて必要となったとき、アプリケーションに対するプロセスを作成します、そのときにすべてのコンポーネントがそのプロセス内に実行されます。デフォルトのプロセス名は <manifest> 要素により設定されたパッケージ名と合致します。
  • 他のアプリケーションと共有されるプロセス名に対しこの属性を設定することにより、両方のアプリケーションを同じプロセスで実行するようにアレンジすることができます。しかし、それが可能なのは、両方のアプリケーションがユーザ ID を共有し、同じ証明書での署名されている場合のみです。
  • この属性にコロン (':') で始まる名前を割り当てる場合は、新たなプロセスが、アプリケーションでプライベートで、それが必要となったときに作成されます。プロセス名が小文字で始まる場合は、その名前でグローバルなプロセスが作成されます。グローバルプロセスが他のアプリケーションと共有可能となり、利用するリソースを節約につながります。

関連