至于这个结构图中的manager和实际中的service是否一一对应,还要看。
现在一个个的来找对应。
1 statusbarservice 对应statusbarmanager
/frameworks/base/core/java/android/app/StatusBarManager.java
在statusbarmanager的构造函数中,会实例化一个IStatusBar mService,同时向外暴露几个接口,
disable, expand, collapse, toggle, addIcon, updateIcon ,removeIcon,这几个向外暴露的方法都是通过调用mService的方法,也即是statusbarservice中的方法来实现。
SDK中并没有找到该类,可见该类并没有暴露给用户使用,只是给android内部使用。
2. powermanagerservice与powermanager对应
通过powermanager向外暴露接口。具体的接口用法,用途可以看响应的方法注释。
SDK中可以看到其类 android.os.PowerManager
其中说明用途的一句:This class gives you control of the power state of the device.
具体的使用可以看SDK的说明。
3. ActivityManagerService这里的对应实现方法有区别,ActivityManagerService是通过继承binder的类ActivityManagerNative来实现的。
ActivityManagerService与ActivityManager相对应。ActivityManager向外暴露接口方法。
SDK中有其类 , android.app.ActivityManager 提供给用户使用。
说明 :Interact with the overall activities running in the system. 具体的用法参见SDK。
4.TelephonyRegistry对应暴露的接口的manager没有找到,也许没有暴露,也许通过其他的方法。
5.PackageManagerService.java 与PackageManager.java
/frameworks/base/core/java/android/content/pm/PackageManager.java
SDK:android.content.pm.PackageManager 抽象类
SDK中注释:
Class for retrieving various kinds of information related to the application packages that are currently installed on the device. You can find this class throughgetPackageManager()
.
6.ContentService
没有找到对应的manager,可能由provider提供接口。
7.BatteryService 对应BatteryManager
SDK:android.os.BatteryManager
SDK中注释:
The BatteryManager class contains strings and constants used for values in theACTION_BATTERY_CHANGED
Intent.
8.HardwareService 没有找到对应的类来暴露其接口,可能没有做
9.AlarmManagerService对应AlarmManager.java
/frameworks/base/core/java/android/app/AlarmManager.java
SDK:android.app.AlarmManager
SDK中注释:This class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future.
10.SensorService 对应 SensorManager.java
/frameworks/base/core/java/android/hardware/SensorManager.java
SDK:android.hardware.SensorManager
SDK中注释:Class that lets you access the device's sensors. Get an instance of this class by callingContext.getSystemService()
with an argument ofSENSOR_SERVICE
.
11.WindowManagerService 对应 WindowManager.java
/frameworks/base/core/java/android/view/WindowManager.java
SDK:android.view.WindowManager 接口
SDK中注释:
The interface that apps use to talk to the window manager.
UseContext.getSystemService(Context.WINDOW_SERVICE)
to get one of these.
12. BluetoothDeviceService对应 BluetoothDevice(待验证)
13.StatusBarService对应StatusBarManager
SDK中没有
14.ClipboardService 对应ClipboardManager.java
/frameworks/base/core/java/android/text/ClipboardManager.java
SDK: android.text.ClipboardManager
SDK中注释:
Interface to the clipboard service, for placing and retrieving text in the global clipboard.
You do not instantiate this class directly; instead, retrieve it throughgetSystemService(String)
.
15.InputMethodManagerService对应InputMethodManager
frameworks/base/core/java/android/view/inputmethod/InputMethodManager.java
SDK中居然没有!!
16.NetStatService NetStat.java
frameworks/base/core/java/android/os/NetStat.java
SDK中没有。
17.ConnectivityService ConnectivityManager.java
/frameworks/base/core/java/android/net/ConnectivityManager.java
SDK: android.net.ConnectivityManager
SDK中注释:
Class that answers queries about the state of network connectivity. It also notifies applications when network connectivity changes. Get an instance of this class by callingContext.getSystemService(Context.CONNECTIVITY_SERVICE)
.
The primary responsibilities of this class are to:
- Monitor network connections (Wi-Fi, GPRS, UMTS, etc.)
- Send broadcast intents when network connectivity changes
- Attempt to "fail over" to another network when connectivity to a network is lost
- Provide an API that allows applications to query the coarse-grained or fine-grained state of the available networks
18.AccessibilityManagerService AccessibilityManager.java
/frameworks/base/core/java/android/view/accessibility/AccessibilityManager.java
SDK中没有。
19. NotificationManagerService NotificationManage
SDK: android.app.NotificationManager
SDK中注释:
Class to notify the user of events that happen. This is how you tell the user that something has happened in the background.
Notifications can take different forms:
- A persistent icon that goes in the status bar and is accessible through the launcher, (when the user selects it, a designated Intent can be launched),
- Turning on or flashing LEDs on the device, or
- Alerting the user by flashing the backlight, playing a sound, or vibrating.
20.MountService 没有找到对应
21.DeviceStorageMonitorService 没有找到对应
22. LocationManagerService 没有对应,自身就是一个manager
23.SearchManagerService SearchManager.java
SDK:android.app.SearchManager
SDK中注释:
This class provides access to the system search services.
In practice, you won't interact with this class directly, as search services are provided through methods inActivity
methods and the theACTION_SEARCH
Intent
. This class does provide a basic overview of search services and how to integrate them with your activities. If you do require direct access to the SearchManager, do not instantiate this class directly; instead, retrieve it throughcontext.getSystemService(Context.SEARCH_SERVICE)
.
24.WallpaperService
25.AudioService
26.BackupManagerService
27. AppWidgetService 对应 AppWidgetManager.java
SDK中没有
以上为android提供的基本service,也许有对应的manager向外暴露接口,也许有对应的provider提供数据,也许没有暴露,需要用到的时候进一步查看。
相关推荐
什么是Android应用? PackageManager相关 ActivityManager相关
这次主要是实现了应用管理器对其他应用程序的运行、分享、卸载功能,具体流程大家可以参考本人博客http://blog.csdn.net/acrambler,资源都是可以正常运行的,有什么问题请到博客中留言交流,在资源中留言,无法回复...
Android手机应用管理源码,一个安卓手机上的应用管理程序,附有完整的源代码,Android的环境真不好调啊,没抓到运行截图,Android达人自己下载源码摸索吧,这个软件不但可以却手机上的应用进行管理,还具备进程管理...
android简单的应用程序管理器,实现的手机上的应用程序的管理,主要是运行和卸载。
《Android应用开发详解》 作者:郭宏志 编著 内容简介 本书分为三个部分,包括基础篇、技术篇和应用篇。由浅入深地讲述了Android应用开发的方方面面。 第一篇 基础篇 第1章 Android概述 Android概述,讲述了...
应用管理器,主要功能为卸载应用、打开应用、显示应用、显示应用主要信息、显示应用详细信息,打开应用有主界面导航,主界面内有动画效果,还有按安装时间、应用大小、应用名排序的功能。
这个PPT讲Android应用程序进程的启动和回收,主要涉及到Zygote进程、System Server进程,以及组件管理服务ActivityManagerService、窗口服务WindowManagerService,还有专用驱动Low Memory Killer。通过了解Android...
Android应用源码11套安卓源码合集: Android Gps日志记录程序源码.rar Android listview 滑动删除(具体效果360手机卫士后台通知).rar Android MP3播放器,带卡拉OK字幕.rar Android “遇见”android应用源码.rar ...
Android应用源码可以管理U盘的文件管理器
一款实用Android平台上的应用开机启动项管理
基于Android的志愿服务管理APP的实现.pdf
基于Android系统的工具设备管理APP研究与应用.pdf
一个现代,简便和可定制的Android应用管理器,拥有root功能和Material Design
资源在Android应用程序编译的过程中,也会被编译成二进制格式。这是为了压缩资源存储空间,以及加快运行时的资源解析速度。Android应用程序在运行的时候,资源管理器AssetManager和Resources会根据当前的机器设置,...
android应用管理源码
悬浮窗,大家应该也不陌生,凌驾于应用之上的一个小弹窗,实现上很简单,就是添加一个系统级别的窗口,Android中通过WindowManagerService( WMS)来管理所有的窗口,对于WMS来说,管你是Activity、Toast、Dialog,...
本代码主要有数据库的增删改查,闹钟提醒等功能,还有时间设置控件的应用等界面元素的应用,内附有设计文档。希望能帮助各位。
在Android应用程序中,有一类特殊的消息,是专门负责与用户进行交互的,它们就是触摸屏和键盘等输入事件。触摸屏和键盘事件是统一由系统输入管理器InputManager进行分发的。也就是说,InputManager负责从硬件接收...
Android应用源码之软件管理器.zip
SQlite Android SQLite的应用 简易的学生成绩管理系统 1.用到类似表单的界面。界面美观清晰。 2.搭建ListView WIdget组件。单击列表项即可对其删除修改。 3.实现了对学生信息的增,删,改,查。