GithubHelp home page GithubHelp logo

neamssample's Introduction

ActivityManagerService架构设计源码分析

[TOC]

一、核心理论

1.1 基础概念

1.1.1 什么是ActivityManagerService

AMSActivityManagerService承担了Android四大组件的启动、切换、调度以及进程的管理工作,掌握了所有应用的创建、启动、管理,是Android中最核心的服务。

image

1.1.2 组件与AMS的通讯方式

Activity最后通过调用ActivityManagerProxy,然后通过Binder机制同ActivityManagerService通讯,因为两种属于不同的进行(AMS属于系统进程)。

image

1.1.3 AMS体系化关系图

AMS体系化关系图如下图所示:

image

1.2 源码分析

1.2.1 startService流程

image

1.2.2 Activity跨进程跳转源码分析

Activity跳转到另一个Activity经历了两次跨进程过程:首先从用户端进程调用系统进程,然后系统进程调用用户端进程回到用户端,源码调用时序图如下图所示:

image

neamssample's People

Contributors

tianyalu avatar

Watchers

James Cloos avatar  avatar

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.