Android Process II

Source: Internet
Author: User

I. IPC Communication settings
1. androidmanifest.xml file
An app can occupy multiple processes
<service android:name= ". MyService "
android:process= ": Remote" >//independent one process named remote
Android Each process has a VM

Second, IBinder interface
1, using Java interface defined interface, for cross-process calls
The IPC communication of the Android framework relies on a single IBinder interface, the client invokes the Transact (business) function of the IBinder interface, and calls the remote Ontransact function through the IPC mechanism
2, Android source code, Java layer of the IBinder interface is defined in the Ibinder.java codes of the document
public interface ibinder{
Code Code PARCEL (package) The data returned by the outgoing data
public boolean transact (int code, PARCEL data, Parcel replay, int flags) throws RemoteException
}
3, IBinder two implementation class
Binders and Binderproxy

IBinder---> binderproxy (Agent)
------------------------IPC mechanism
IBinder---> Binder
4. Basic process
Client Side Binderproxy
|
Java---> Transact () (Transact () function for JNI local modules)---> Binder Driver Drive Service
|
--------------------------Linux Forwarding-----------------
|
Service-Side Binder

<--init () calls Java--
---> exectransact ()---> ontransact ()---> IOC (Implementation class implementation ontransact ())

Android Process II

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.