Successfully reported this slideshow.

Android Services and Managers Basic


Published on

Describe how to use Android Manager and list Service/Manager pairs found in Honeycomb 3.2.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Android Services and Managers Basic

  1. 1. Android Frameworks - Service & Manager Basic (Honeycom 3.2) William.L Date: 2011-11-04
  2. 2. Outline Introduction How to use Manager? Service & Manager pairs
  3. 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. 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. 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
  6. 6. Service/Manager pairs (2/4) Service BackupManagerService Manager BackupManager CacheService CacheManager ClipboardService ClipboardManager ConnectivityService ConnectivityManager DevicePolicyManagerSe DevicePolicyManager rvice (do service getting internal) DownloadService DownloadManager DropBoxService DropBoxManager
  7. 7. Service/Manager pairs (3/4) Service InputMethodManagerSer vice LocationManagerService MountService NfcService SearchManagerService SipService Manager InputMethodManager LocationManager StorageManger NfcManager SearchManager SipManager (do service getting internal)
  8. 8. Service/Manager pairs (4/4) Service StatusBarManager Service ThrottleService Manager StatusBarManager (do service getting internal) ThrottleManager UsbService VpnService WallpaperManager Service WifiService UsbManager VpnManager WallpaperManager (do service getting internal) WifiManager