1. Service
(1) Meaning: Service is an application component that runs in the background for a long time, and the threads are the main thread.
(2) How to use: StartService can perform onstartcommand operations, Bindservice can return the instance object of the service to the activity, thus enabling the use of service in the activity. Instead, the service object was created with the new method without an error, but the service's method could not be successfully invoked.
(3) Note: In Onstartcommand, the teacher suggested that we change the return value to Start_not_sticky, look at the API documentation, you can know that the value of the approximate meaning is that after the service was killed, if not passed in the new intent, it will not be re-created.
2, Broadcastreceiver
(1) Registration method: Register as a static registration in the Androidmanifest.xml, dynamic registration in. Java, dynamic registration also requires dynamic logoff.
(2) Other: In the activity, the service can set the internal broadcast receiver.
3. Widgets
(1) Regarding widgets, I can only understand that it is a desktop widget that can run directly on the desktop. Others are not understood, including the creation of a teacher's presentation.
Simple learning experience: NetEase Cloud Classroom Android Development fourth chapter service, broadcast and cool features