HERE Android SDK Developer's Guide

Private Venues

This feature allows you to use a different source of venue data in addition to or instead of the default HERE backend. The private content backend must be configured by HERE, which is an operation transparent to a developer using the HERE Android SDK. Access to private venue data is at the discretion of its legal owner, and by definition, it is not public.

Note: For more information about configuring a private venue data backend, contact your HERE representative.

If a private backend has been configured, call the setPrivateContent(boolean) method on the VenueService class at MapFragment initialization to indicate that you want your application to use it.

The code below demonstrates a call to this method. Note that the code does not show the entire MapFragment initialization sequence.

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Initialize the Map Fragment to have a map created and attached to
  // the fragment
  m_mapFragment.init(new OnEngineInitListener() {
    @Override
    public void onEngineInitializationCompleted(Error error) {
      if (error == Error.NONE) {
        m_map = (Map) m_mapFragment.getMap();

        // Set access to private venue data:
        m_mapFragment.getVenueService().setPrivateContent(true);
        // Remember to start or restart Venue Service after setting private content
      } else {
        System.out.println("ERROR: Cannot initialize Map Fragment" + error.toString());
      }
    }
  });
} 

Dynamic Content

By default, the HERE SDK uses public HERE 3D venue content. It is possible to use customer-specific content instead by calling the VenueService.setPrivateContent(boolean) method, as shown in the examples below. It is also possible use both private and public content together, and define which one has priority. If this kind of combined content is needed, use VenueService.setIsCombinedContent(boolean).

// Obtain VenueService
VenueService service = m_mapView.getVenueService();

// Use only HERE SDK content (this is the default behavior)
Service.setPrivateContent(false);
Service.setIsCombinedContent(false);

// Use only private content
Service.setPrivateContent(true);
Service.setIsCombinedContent(false);

// Prefer HERE SDK content and use private as an alternative
Service.setPrivateContent(false);
Service.setIsCombinedContent(true);

// Prefer private content and use HERE SDK as an alternative
Service.setPrivateContent(true);
Service.setIsCombinedContent(true);

Multiple VenueService objects can run at the same time. For example, if some part of an application requires access to only private content, and another part requires HERE SDK content, two VenueService objects can be instantiated and configured differently. Activities in one service do not have an impact on another service. For example, notifications related to loading (onVenueLoadCompleted(Venue, VenueInfo, VenueLoadStatus)) are sent only to the client that initiated the load. To obtain an additional VenueService object, use the static createAdditionalService(Context) method.

VenueService mMainInstance;
VenueService mAdditionalInstance;
mMainInstance =
  VenueService.getInstance(getActivity().getApplicationContext());
mAdditionalInstance =
  VenueService.createAdditionalService(getActivity().getApplicationContext());

For more information, see the API Reference.

Note: VenueService is also invoked when VenueMapFragment or VenueMapView is used. As such, some venue features can be used in a common manner between these classes.