C + + Layer implementation Binder Service example

Source: Internet
Author: User
Tags git clone

This paper studies the implementation of binder service and wants to write a binder example.

On the Internet and books have seen similar examples, according to write, found that they are not what they want, not quite in line with the style of the source code.
Streamlined one from the binder service of the source code.
Problems encountered:
1, frameworks/native/include/binder/iinterface.h:50:error:undefined reference to ' android::refbase::~refbase () '
Reason: No add only added Libbinder library, not add Libutils library,
2, ITest.h TestService.h header file where to be included.
I put it on the Framework/av/include/media.
Only include <media/ITest.h> can be quoted.


But can you put it in any directory of your own definition? such as:./test/include/test/itest.h
#include "ITest.h" compilation does not find the header file. You also need to specify the header file path in Android.mk
Local_c_includes: = $ (Local_path)/. /include/test can be.
3, my example print log is used Aloge and so on. There are loge in the code base

Write an example: Despite a few lines of code I also toss to two or three days. See will, never necessarily will, hands is the reason.


Code View address: Https://github.com/langxianwen/binder-demo

git path: Git clone https://github.com/langxianwen/binder-demo.git


C + + Layer implementation Binder Service example

Related Article

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.