S60 Map and Navigation Provider Discovery API |
DN0669115 |
CONFIDENTIAL |
Version |
Date |
Status |
Description |
---|---|---|---|
1.0 |
10.12.2006 |
Approved |
|
![]() |
This API enables client to find out what provider applications are installed and available to use with Map and Navigation API and Geocoding API and retrieve their related information.
![]() |
This API is intended for applications, which utilize Map and Navigation API and/or Geocoding API. It gives access to the list of available provider applications, which can be used with those APIs and detailed information about them.
![]() |
The main use cases provided by the API are the following:
![]() |
![]() |
This API is a helper for Map and Navigation API and Geocoding API. Its main purpose is to find provider applications, which can be used with these APIs, and supply related information on them.
![]() |
In order to find provider applications for map view, navigation and geocoding services, the client uses the MnProviderFinder class. It is a static class, which implements two use cases: find all provider applications or find only those applications, which support specific features.
![]() |
The following example shows how to find a specific provider application (explicitly identified by its application UID) among all available provider applications. The example is given in the form of a function, which retrieves a list of all providers, compares all providers with the given UID and returns the matching one, if found. The client gets ownership of the object. The function leaves if no match is found.
CMnProvider* GetProviderL( TInt aUid ) { CMnProvider* provider = NULL; RPointerArray<CMnProvider> providers; // get all providers MnProviderFinder::FindProvidersL( providers ); // now find the one, which matches given UID for ( TInt i = 0; i < providers.Count(); i++ ) { if ( providers[i]->Uid().iUid == aUid ) { provider = providers[i]; break; } } // cleanup array and return result if ( provider ) { // if found, remove it from the array TInt pos = providers.Find( provider ); providers.Remove( pos ); // others are destroyed providers.ResetAndDestroy(); } else { // if nothing's found, destroy all and leave providers.ResetAndDestroy(); User::Leave( KErrNotFound ); } return provider; }
![]() |
The following example shows how to find a provider application, which supports specified services among all available provider applications. The example is given in the form of a function, which retrieves a list of providers, supporting specified services and returns the first one found. The client gets ownership of the object. The function returns NULL if a match is not found.
CMnProvider* GetFirstProviderL( CMnProvider::TServices aServicesNeeded ) { RPointerArray<CMnProvider> providers; MnProviderFinder::FindProvidersL( providers, aServicesNeeded ); TInt count = providers.Count(); CMnProvider* provider = NULL; if ( count ) { provider = providers[0]; providers.Remove( 0 ); } providers.ResetAndDestroy(); return provider; }
The input parameter of the function is the bitmap of service constants, defined in the CMnProvider class. Callers may request that the provider should support only a single service or a set of services.
// find provider for map view service CMnProvider* mapViewProvider = GetFirstProviderL( CMnProvider::EServiceMapView ); // find provider for geocoding and navigation services const CMnProvider::TServices neededServices = CMnProvider::EServiceNavigation | CMnProvider::EServiceGeocoding; CMnProvider* geocodingAndNavigationProvider = GetFirstProviderL( neededServices );
Note that in the latter case, if no providers support both geocoding and navigation services, NULL is returned.
![]() |
Provider application information can be retrieved from the CMnProvider class. Methods of the class return various information about the provider application, such as application and vendor localized names, application UID and version, supported services. See CMnProvider class documentation for details.
![]() |
![]() |
Landmark |
A landmark is principally a location with a name. |
Provider application | An application, which implements map, navigation and geocoding services and provides access to these features for clients of Map and Navigation API and Geocoding API. |
![]() |