android:process= ": Remote" property commentary

Source: Internet
Author: User

in Learning Android Service component, a problem is encountered in the process of Android application's claim file manifest.xml The relevant service tag is sometimes set to a android:process= ": Remote", How does this attribute work? The following author will organize their knowledge and share with you.

        in theAndroidHelp document we can see that in general, a service does not have its own independent process, which is typically run as a thread in the process of the application in which it resides. But there are exceptions,Androidin the declaration fileandroid:processproperty can be used for any component, including applying a specified process, in other words, by setting in the declaration fileandroid:processProperties,We can let components (such asActivity, Serviceetc.) and applications(application)created and run in the process we specified. The following is the relevant information and the author's translation.


                    If we need to have a service run in a remote process (instead of the standard apk android:process

                    Note: here Select " remote " this name is arbitrary, you can use other names to make the service run in another process. Colon ': '

For example: an app package named com.aoyousatuo.example,   com.aoyousatuo.example:remote. ( Note that if the component or application in the declaration file does not specify this property then the default app and its components will run in a process named after their package name. ).


Android:process

               The name of the process where the service is located. Typically, all components of an app run in the default process that the system creates for the app. This default process is named after the application's package name.

                process property can be set to a default value that differs from all components. However, these components can be set by setting their own process

                If the process name that is set starts with a colon, the new process is private to the application. This new process will be created when it is needed or if the service needs to be run in a new process. If the name of the process starts with a lowercase character, the service will run in a global process named after that name, assuming that it has the appropriate permissions. This allows various components in different applications to share a single process, thereby reducing the resource footprint.

                com.aoyousatuo.example android:process com.rabbit.man, The new process name is com.rabbit.run.

android:process= ": Remote" property commentary

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.