. getBinder (); // return the Binder interface }}
Some code in MyActivity
The above code is very simple.
Let's take a look at the Messenger source code is actually a packaging class, which itself is the object that can be delivered by IPC, because the Parcelable interface is used.
Public Messenger (Handler target) {// The Handler previously passed here, mTar
I. Overview of the OutlookRecently to implement the Android registration activity can run the problem, then the result is done, Just can not be declared in the Androidmanifest.xml this activity can run, mainly through cheat system, steal dragon turn Phoenix technology, this knowledge point will be explained in detail, because in the process of studying this problem encountered a lot of knowledge points, of course, the most important is the most fundamental is the Android B Inder mechanism and re
Publicibinder onbind (Intent Intent) {//③: Returns the binder of the Messenger object to the client returnMmessenger.getbinder (); }} Step two: Client side receive Messenger send message to service side Public classMainactivityextendsappcompatactivity {Private Static FinalString TAG = "Mainactivity"; PrivateMessenger Mservice; @Overrideprotected voidon
The process property of the server-side messengerservice specifies that its processes and mainactivity are not in a process service android:name="com.example.activity.MessengerService" android:process="com.example.activity.remote" > service>Create a messenger in Messengerservice with its underlying binder as the IBinder object returned by the binding service. privatefi
Tags: implementing details message man lightweight bind one another netThe use of Messenger in cross-process communication Pre-stated: I am also a beginner, so this article is from a beginner's point of view, if there are inappropriate places please leave a message to teach me, thank you. This article is intended to explain the use of Messenger and the principle of Me
For details about the Binder design idea and Driver layer implementation, refer to: Android Binder Design and Implementation-design. Here we will give a brief introduction.
Each Binder entity of the Service is located in the process type of the Service. The Binder entity is represented as binder_node in the driver, and
1. binder communication OverviewBinder communication is a client-server communication structure,1. On the surface, the client directly calls the server by obtaining a proxy interface of the server;2. In fact, the methods defined in the proxy interface correspond one to one with those defined in the server;3. When the client calls a method in a proxy interface, the proxy interface method packs the parameters passed by the client into a Parcel object;4.
This article was reprinted from: 70082302An overview of inter-process communication mechanisms in Android-binderRecently in the study of binder mechanism, on-line access to a large number of information, but also see Lao Luo's binder series of blogs and innost in-depth understanding of the binder series of blogs, all from the bottom of the story, all C code, alth
5.3 Statement of Binder in Driver
Driver is the core of Binder communication. All Binder entities in the system and references of each entity in each process are registered in the driver; the driver must record the many-to-one relationship between the Binder references-> entities; find the corresponding entities for th
Android Binder Mechanism introduction, androidbinder Mechanism
Some people who have developed Android may have some experience. At the early stage of getting started, their work mainly involves implementing various UI interfaces and implementing the business logic of applications. At this stage, we will gradually become familiar with the View system and learn to implement various interfaces and animation effects. In the future, when we want to learn m
To understand the Android code, first understand the binder mechanism. The binder mechanism is also an elusive piece of Android, documenting the important concepts and implementations of binder as a memo. Part of the content from the Internet, if there is infringement, please timely inform.1.binder Communication Mechan
(1) OverviewAndroid's binder Mechanism provides a method for inter-process communication, so that a process can call the functions provided by another process in a way similar to a remote process call. The binder mechanism is provided in both the Java environment and the C/C ++ environment.In the android code, the binder with C/C ++ includes some types and interf
Recently saw a blog, is to talk about the binder principle, before looking at the deep understanding of Android I have seen, at that time do not understand. Feel this also a bit of meaning, looked for a few days, found the more see the more do not understand, and then look at Lao Luo's blog, found also not too understand, now want to according to the book of Things Good comb under binder.The sense inside should be focused on should be Bind_node is the
In Android, each application is made up of activity and service that are likely to run in the same process or run in different processes. So how do you communicate with an activity or service that is not in the same process? This is the binder interprocess communication mechanism to be introduced in this article.
We know that the Android system is based on the Linux kernel, and the Linux kernel inherits and is compatible with the rich Unix system int
Article reprinted to CSDN community Luo Shenyang's Android tour, original address: http://blog.csdn.net/luoshengyang/article/details/6618363In Android, each application is made up of activity and service that are likely to run in the same process or run in different processes. So, how does the activity or service in the same process communicate? This is the binder interprocess communication mechanism to be described in this article.We know that the An
Android developers may have some experience, early in the beginning, the work is mainly to achieve a variety of UI interface, as well as the implementation of the business logic of the application. At this stage, we will gradually become familiar with the view system, gradually learn to achieve a variety of interface and animation effects. Later, when we want to learn more about Android, such as the start-up process of Android four components, AMS, PMS and so on, will encounter a thing called
In Android, each application is made up of activity and service that are likely to run in the same process or run in different processes. So, how does the activity or service in the same process communicate? This is the binder interprocess communication mechanism to be described in this article.We know that the Android system is based on the Linux kernel, while the Linux kernel inherits and is compatible with the rich Unix system interprocess communic
In Android systems, each application is composed of multiple activity and service parts, and these activity and service are likely to be executed in the same processing, in addition, can also be performed in different processes.And then. How does activity or service communicate in the same process? This is the binder interprocess communication mechanism to be described in this article.We know that the Android system is based on the Linux kernel, while
This article is based on the source code Scenario Analysis of the Android system, by Luo shengyang.
I ,~ /Android/frameworks/base/cmd/servicemanager
----- Binder. h
----- Binder. c
----- Service_manager.c
~ /Android // kernel/goldfish/drivers/staging/android
----- Binder. c
----- Binder. h
Ii. Source Code Analysis
1.
4 Binder Protocol
The basic format of the Binder protocol is (command + data). The ioctl (fd, cmd, arg) function is used for interaction. The command is carried by the cmd parameter, and the data is carried by the arg parameter, which varies with the cmd parameter. The following table lists all commands and their corresponding data:
Table 2 Binder communication c
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.