Android 安卓框架。它是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2968016/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:06:08  来源:igfitidea点击:

Android framework. What is it?

android

提问by Confused

I've few questions on Android Framework. Can someone please answer them

我对 Android 框架有几个问题。有人可以回答他们吗

  1. What does an Android Framework do? What is it's job?

  2. What are these managers - Activity Manager, Location Manager etc? Are they APIs or libraries?

  3. I heard that the definition of a framework is - a set of libraries that say “Don't call us, we'll call you.” So can I say that Activity Manager, Location Manager etc are such libraries? Or is it that they are not libraries but APIs (used to access underlying c/c++ libraries) and the actual libraries that do "Don't call us, we'll call you." are hidden from us?

  1. Android 框架有什么作用?它的工作是什么?

  2. 这些管理器是什么 - 活动管理器、位置管理器等?它们是 API 还是库?

  3. 我听说框架的定义是——一组写着“不要打电话给我们,我们会打电话给你”的库。那么我可以说活动管理器、位置管理器等就是这样的库吗?或者它们不是库,而是 API(用于访问底层 c/c++ 库)和执行“不要打电话给我们,我们会打电话给你”的实际库。对我们隐藏?

回答by mtmurdock

  1. The android framework is the set of API's that allow developers to quickly and easily write apps for android phones. It consists of tools for designing UIs like buttons, text fields, image panes, and system tools like intents (for starting other apps/activities or opening files), phone controls, media players, ect. Essentially an android app consists of Activities (programs that the user interacts with), services (programs that run in the background or provide some function to other apps), and broadcast receivers (programs that catch information important to your app). The best way to learn this system will be to go through the Google Tutorials found here

  2. AcitivityManager and LocationManager are examples of classes found in the android sdk (the framework). I do not know of any use for these classes, as I believe they are part of the system. I have never used them, but if you wanted to learn more about them i would look at the Android API

  3. I believe your question is a bit 3 dimensional:

    • A library is a code source that a developer and add to their application. It is not source code, thus the inner details are hidden to the developer. You can only access the visible (public) parts.

    • An API is the documentation that accompanies a library to explain how to use the library (an example of this is the Android API listed above)

  1. android 框架是一组 API,允许开发人员快速轻松地为 android 手机编写应用程序。它由用于设计 UI 的工具(如按钮、文本字段、图像窗格)和系统工具(如意图(用于启动其他应用程序/活动或打开文件)、电话控件、媒体播放器等)组成。本质上,Android 应用程序由活动(用户与之交互的程序)、服务(在后台运行或为其他应用程序提供某些功能的程序)和广播接收器(捕获对您的应用程序重要的信息的程序)组成。学习该系统的最佳方式是浏览此处的 Google 教程

  2. AcitivityManager 和 LocationManager 是 android sdk(框架)中的类示例。我不知道这些类有什么用处,因为我相信它们是系统的一部分。我从未使用过它们,但如果您想了解更多关于它们的信息,我会查看Android API

  3. 我相信你的问题有点 3 维:

    • 库是开发人员添加到其应用程序中的代码源。它不是源代码,因此对开发人员隐藏了内部细节。您只能访问可见(公共)部分。

    • API 是伴随库的文档,用于解释如何使用该库(例如上面列出的 Android API)

So to answer your question, ActivityManager and LocationManager are neither libraries nor APIs. Rather, they are classes withinthe Android SDK (which is a library) that are used by either the system, or the developer (if he can find any use for them). Also, everything in android is Java, so you wont find any C/C++ libraries for android

因此,要回答您的问题,ActivityManager 和 LocationManager 既不是库也不是 API。相反,它们是班由两种系统,或者开发人员使用(如果他能找到他们的任何使用)的Android SDK(这是一个库)。此外,android 中的所有内容都是 Java,因此您找不到任何适用于 android 的 C/C++ 库

I hope that this answer was helpful for you.

我希望这个答案对你有帮助。

回答by CaseyB

The Android Framework is the entire stack of stuff that makes up the OS. This is the underlying Native libraries that are not directly accessible, the layer above that that you actually interact with and the code that developers write to run on the system. Yo are confused about Libraries vs APIs. Libraries are just chunks of useful code, APIs are the interface to those libraries. API actually stands for Application Programming Interface. The Managers do exactly what it says on the tin! The Activity Manager is the class that manages Activities, the Location Manager manages your current location.

Android 框架是构成操作系统的整个堆栈。这是无法直接访问的底层 Native 库、您实际与之交互的上层以及开发人员编写的在系统上运行的代码。你对库和 API 感到困惑。库只是有用的代码块,API 是这些库的接口。API 实际上代表应用程序编程接口。经理们完全按照罐头上所说的去做!活动管理器是管理活动的类,位置管理器管理您当前的位置。

回答by Rishi

Android framework is a set of those classes and methods whose fuctionalities can be selectively overridden by the user like examples content providers,activity managers,Location manager,Telephony manager etc.

Android 框架是一组类和方法,其功能可以由用户选择性地覆盖,例如示例内容提供者、活动管理器、位置管理器、电话管理器等。

Activity manager or Location manager are the classes whose methods can be override to use it as per the need of the output of the programme.

活动管理器或位置管理器是可以根据程序输出的需要重写其方法以使用它的类。

回答by ranvir singh

Android framework has APIs which are provided for android application development. Using these APIs, apps can access android functionalities like Wifi, BT, NFC etc.

Android 框架具有为 Android 应用程序开发提供的 API。使用这些 API,应用程序可以访问 Android 功能,如 Wifi、BT、NFC 等。