javax.microedition.location.services
Interface ServiceListener

All Known Subinterfaces:
MapServiceListener, NavigationServiceListener

public interface ServiceListener

This is a super interface for all listeners related to different services. It contains the common methods for all service listeners.

When a callback method in this interface is called, the service request has ended for some reason, except for the serviceDataStatus notification. This means that the application then gets back the focus on the user interface and should behave accordingly.

Since:
2.0

Field Summary
static int SERVICE_DATA_LOADING
          Service status code indicating that the service just started loading new data over the network.
static int SERVICE_DATA_LOADING_DONE
          Service status code indicating that the service finished loading new data over the network.
 
Method Summary
 void configurationCompleted(ServiceProvider provider, ServicePreferences preferences)
          Called by the API implementation or service provider when the configuration UI has been completed.
 void requestAborted(ServiceProvider provider)
          Called by the API implementation or service provider when the service request has been aborted by the application.
 void requestCanceled(ServiceProvider provider)
          Called by the API implementation or service provider when the service request has been canceled by the user.
 void requestCompleted(ServiceProvider provider)
          Called by the API implementation or service provider when the service requested by the application has been successfully completed.
 void requestError(ServiceProvider provider)
          Called by the API implementation or service provider when there is an error situation, like loss of network connection or location fix, in the service provider that prevents it from finishing the service request.
 void serviceDataStatus(ServiceProvider provider, int code)
          Called by the API implementation or service provider whenever some service data related activities, for example, loading new map data over the network happens, and service provider wants to give feedback to the application.
 

Field Detail

SERVICE_DATA_LOADING

static final int SERVICE_DATA_LOADING

Service status code indicating that the service just started loading new data over the network.

See Also:
Constant Field Values

SERVICE_DATA_LOADING_DONE

static final int SERVICE_DATA_LOADING_DONE

Service status code indicating that the service finished loading new data over the network.

See Also:
Constant Field Values
Method Detail

requestCompleted

void requestCompleted(ServiceProvider provider)

Called by the API implementation or service provider when the service requested by the application has been successfully completed.

Parameters:
provider - the provider whose request has been completed

requestCanceled

void requestCanceled(ServiceProvider provider)

Called by the API implementation or service provider when the service request has been canceled by the user. This can happen for example, when a service provider is handling asynchronous service request.

Whether the user is allowed to cancel an ongoing service requests depends on the service provider. It is not mandated by this specification.

Parameters:
provider - the provider whose request has been canceled

requestAborted

void requestAborted(ServiceProvider provider)

Called by the API implementation or service provider when the service request has been aborted by the application.

Parameters:
provider - the provider which request has been aborted

requestError

void requestError(ServiceProvider provider)

Called by the API implementation or service provider when there is an error situation, like loss of network connection or location fix, in the service provider that prevents it from finishing the service request. This notification is sent after the service provider has already started to execute the request, whereas a ServiceException is thrown before the execution of the service request starts.

Parameters:
provider - the provider which had an error situation

serviceDataStatus

void serviceDataStatus(ServiceProvider provider,
                       int code)

Called by the API implementation or service provider whenever some service data related activities, for example, loading new map data over the network happens, and service provider wants to give feedback to the application.

The code must be one of the constants defined in this interface starting with prefix SERVICE_DATA_.

Parameters:
provider - the ServiceProvider that is transferring data
code - the status code of the data transfer

configurationCompleted

void configurationCompleted(ServiceProvider provider,
                            ServicePreferences preferences)

Called by the API implementation or service provider when the configuration UI has been completed. The preferences set in the configuration UI are included as a parameter. This preferences must be returned in a new instance of the ServicePreferences object.

Parameters:
provider - the provider which configuration UI has been completed
preferences - the updated preferences of the service provider


Copyright © 2003-2008 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.