Android background running in a lot of service, they are systemserver on when the system starts, support the normal operation of the system, such as Mountservice Monitoring for SD card installation and removal, Clipboardservice provides the Clipboard function, Packagemanagerservice provides installation removal and viewing of packages, and so on, applications can access the data provided by the service through the manager interface provided by the system.
Getsystemservice is an important API for Android, a method of activity that obtains the corresponding object based on the name passed in, and then translates it into the appropriate service object. The following describes the system's corresponding services.
| The name passed in |
The returned object |
Description |
| Window_service |
WindowManager |
To manage open Windows programs |
| Layout_inflater_service |
Layoutinflater |
Gets the view defined in the XML |
| Activity_service |
Activitymanager |
Managing the system state of an application |
|
Power_service |
Powermanger |
Service of power supply |
| Alarm_service |
Alarmmanager |
Services for the alarm clock |
|
Notification_service |
Notificationmanager |
Service for status bar |
| Keyguard_service |
Keyguardmanager |
Service for keyboard lock |
| Location_service |
Locationmanager |
Location of the service, such as GPS |
| Search_service |
Searchmanager |
Search for services |
| Vebrator_service |
Vebrator |
Mobile phone Shake Service |
| Connectivity_service |
Connectivity |
Network-connected Services |
| Wifi_service |
Wifimanager |
Wi-Fi Service |
| Telephony_service |
Teleponymanager |
Telephone service |
注意:getSystemService这个方法基于context,只有存在TextView控件的窗体中这个方法才会被激活~
Android's Getsystemservice detailed