The Local Service Controller uses LocalService as a "started" service, which is much simpler than the "Bound" service, Localserviceactivities.controller starts the local Service and basically doesn't care about LocalService.
StartService (New Intent (Controller.this,
localservice.class));
LocalService can choose to stop himself, in this case by calling StopService to stop the service, if you start the service in this example, no stopservice, the service will run in the background, Even if you quit Appdemo or start another application (a triangle will always appear above the screen). And for the local service Binding, the situation is different, after binding service, even if you do not click the "Unbind Service" button, press "Back" key, Binding activity exit, The Android system will automatically disconnect from the LocalService binding. The notification at the top of the screen will automatically disappear.
In addition, in this case LocalService is called the "local" Service, except for the invocation interface between the provided IBinder objects mentioned above, only the same application component is allowed to invoke outside. LocalService is defined in Androidmanifest.xml as:
<service android:name= ". App. LocalService "/>
Does not contain any intent-filter, means that only the service class can be specified through explicit, and different applications generally cannot access this class directly.