public abstract class

WeatherProviderService

extends Service
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ cyanogenmod.weatherservice.WeatherProviderService

Class Overview

This is the base class for implementing a weather provider service. A weather provider service can handle weather update requests and update the weather content provider data by processing a ServiceRequest A weather provider service is declared as any other service in an AndroidManifest.xml but it must also specify that in handles the Intent with action cyanogenmod.weatherservice.WeatherProviderService. Failure to declare this intent will cause the system to ignore the weather provider service. Additionally, a weather provider service must request the BIND_WEATHER_PROVIDER_SERVICE permission to ensure that only the system can bind to it. Failure to request this permission will cause the system to ignore this weather provider service. Following is an example declaration:

    <service android:name=".MyWeatherProviderService"
          android:permission="cyanogenmod.permission.BIND_WEATHER_PROVIDER_SERVICE">
      <intent-filter>
          <action android:name="cyanogenmod.weatherservice.WeatherProviderService" />
      <intent-filter>
      . . .
    </service>
 

Summary

Constants
String SERVICE_INTERFACE The Intent action that must be declared as handled by a service in its manifest for the system to recognize it as a weather provider service
String SERVICE_META_DATA Name under which a WeatherProviderService publishes information about itself.
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Public Constructors
WeatherProviderService()
Public Methods
final IBinder onBind(Intent intent)
Protected Methods
final void attachBaseContext(Context base)
void onConnected()
The system has connected to this service.
void onDisconnected()
The system has disconnected from this service.
abstract void onRequestCancelled(ServiceRequest request)
Called when the system is not interested on this request anymore.
abstract void onRequestSubmitted(ServiceRequest request)
A new request has been submitted to this service
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.content.ComponentCallbacks

Constants

public static final String SERVICE_INTERFACE

Added in API level 5

The Intent action that must be declared as handled by a service in its manifest for the system to recognize it as a weather provider service

Constant Value: "cyanogenmod.weatherservice.WeatherProviderService"

public static final String SERVICE_META_DATA

Added in API level 5

Name under which a WeatherProviderService publishes information about itself. This meta-data must reference an XML resource containing a <weather-provider-service> tag.

Constant Value: "cyanogenmod.weatherservice"

Public Constructors

public WeatherProviderService ()

Added in API level 5

Public Methods

public final IBinder onBind (Intent intent)

Added in API level 5

Protected Methods

protected final void attachBaseContext (Context base)

Added in API level 5

protected void onConnected ()

Added in API level 5

The system has connected to this service.

protected void onDisconnected ()

Added in API level 5

The system has disconnected from this service.

protected abstract void onRequestCancelled (ServiceRequest request)

Added in API level 5

Called when the system is not interested on this request anymore. Note that the service has marked the request as cancelled and you must stop any ongoing operation (such as pulling data from internet) that this service could've been performing to honor the request.

Parameters
request The request cancelled by the system

protected abstract void onRequestSubmitted (ServiceRequest request)

Added in API level 5

A new request has been submitted to this service

Parameters
request The service request to be processed by this service