3. Introduction
There has some class naming rules in Android
framework codes like Service and Manager pairs
The Manager used by applications gets the
Service’s instance and use Service's
services(methods)
Most Services and Managers has the same prefix
likes WifiService and WifiManager or
LocationManagerService and LocationManager
But there has exceptions like MountService and
StorageManager
4. How to use Managers?
Usage:
XXXManager xxxmanager =
(XXXManager)Context.getSystemService(Context.ServiceName);
xxxmanager.XXXServiceMethod(); // Using Service's services, e.g. Methods
or
IBinder iBinder = ServiceManager.getService(Context.ServiceName);
IXXXService service = IXXXService.Stub.asInterface(iBinder);
service.XXXServiceMethod(); // Using Service's services, e.g. Methods
5. Service/Manager pairs (1/4)
The following Service/Manager paris are
found in Android Honeycomb 3.2 currently
Service
Manager
AlarmService
AccessibilityManagerServi
ce
AccountManagerService
AlarmManager
AccessibilityManager
AudioService
AudioManager
BatteryService
BatteryManager
AccountManager