Giter Club home page Giter Club logo

androidipc's Introduction

AndroidBind而IPC

如何学习android

Binder刚开始学习的时候看了不少文章和书,但一直被说得云里雾里看不明白到底是怎么样一回事。这里总结下我是如何学习Binder的机制的过程,初学者可以参考一下避免走弯路。

  • 1.尝试先去找网上的文章看看BInder原理。(第一次看肯定会一头雾水,没关系,了解个大概都在讲什么东西)
  • 2.打开开发工具,写两个APP 用AIDL实现App之间的跨进程通信。(可以参考别人的代码,但是不要Copy代码。手写印象深点)
  • 3.在实现的过程中分析你的消息是如何发送和接受的。
  • 4.打开我们通过AIDL文件系统生成的BInder文件,跟着你代码跳过去看源码的实现。
  • 5.看源码的过程中当你搞明白了Stub是给谁用的,Proxy是给谁用的。为什么要要用Proxy的时候基本就弄明白了AIDL的通信过程了。 (Stub是给服务端用的、Proxy是给调用端用的、使用Proxy的原因是因为可能不在一个进程内。)
  • 6.回过头去看前人的总结,然后自己再做总结。(变成自己的知识流)

tips

本地应用AIDL配置创建一个本地应用调用远程应用提供的方法,同样的在main文件夹下创建aidl文件夹,创建包,包名和远程远程应用aidl里的包名相同,然后把远程应用的aidl文件复制过来

androidipc's People

Contributors

bolexliu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

msdgwzhy6 xwsm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.