0

I did tried some sample code for service and installed the same on device and started the app. I tried to list this service with adb command, which was running now (could see my logs for the same in logcat)

adb shell service list

But, above command lists only system service and could not see my service listed there.

So, my question, 1. Does all services need to register for service manager or it is only the "system services" 2. If i have aidl implemented for this same service will it behave like system service (i mean, get displayed for command like "adb shell service list")

thanks for reading and appreciate any response for my question

-regards, Manju

4

1 回答 1

1

Android system services are different from the sort of services you create within an app. You don't need to worry that they don't appear within adb shell service list.

System services are provided in the ROM of the phone and are core parts of the Android OS, for example the "surface flinger" (graphics compositor), "package manager" etc. They are accessed within the Android frameworks so that a typical Android application developer never contacts them directly. They are looked up based on a simple string.

Normal services inherit from the Service class and you connect to them from within application code using an Intent and typically Context.bindService.

于 2013-05-21T14:33:19.287 回答