RemoveUpdates
Here, we just shut down the location‑monitoring logic, in addition to chaining upward to the superclass for any Android internal bookkeeping that might be needed.
In addition to those lifecycle methods, though, your service also needs to implement . This method returns an , which is the linchpin behind the IPC mechanism. If you’re creating a service class while reading this chapter, just have this method return null for now, and we’ll fill in the full implementation in the next section.
When IPC Attacks!
Services will tend to offer inter‑process communication (IPC) as a means of interacting with activities or other Android components. Each service declares what methods it is making available over IPC; those methods are then available for other components to call, with Android handling all the messy details involved with making method calls across component or process boundaries.
The core of this, from the standpoint of the developer, is expressed in AIDL: the Android Interface Description Language. If you have used IPC mechanisms like COM, CORBA, or the like, you will recognize the notion of IDL. AIDL describes the public IPC interface, and Android supplies tools to build the client and server side of that interface.
With that in mind, let’s take a look at AIDL and IPC.
Дата добавления: 2015-05-16; просмотров: 769;