The Local service Controller uses LocalService as a "Started" service, which is much simpler than the "Bound" service, Localserviceactivities.controller started the local Service, it basically doesn't matter localservice.
StartService (new Intent (Controller. this, LocalService. class));
LocalService can choose to stop itself, this example is by calling StopService to stop the service, if you start the service in this example, there is no stopservice, the service will run in the background, Even if you exit Appdemo or launch another app (a triangle will always appear above the screen). 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, the binding activity exits, The Android system will automatically disconnect from the LocalService. Notification at the top of the screen will disappear automatically.
In addition, this example LocalService is called the "Local" Service, except for the call interface between the IBinder objects mentioned above, allowing only the components of the same application to be called outside. LocalService is defined in Androidmanifest.xml as:
<service android:name= ". App. LocalService "/>
Does not contain any intent-filter, which means that the service class can only be specified through explicit, which generally cannot be accessed directly by different applications.
"Sail Plan 035" 2015 sail plan Android Apidemo Devil step app->service->local Service Controller