HERE Android SDK Developer's Guide

OnSendLocationListener

The interface OnSendLocationListener is a member of com.here.android.mpa.nlp.Nlp.

Interface Summary

public static abstract interface Nlp.OnSendLocationListener

   extends com.here.android.mpa.nlp.Nlp.ListenerBase

The send location event listener interface

[For complete information, see the section Interface Details]

Method Summary

Table 1. Methods in OnSendLocationListener
Methods

public abstract void onSendLocation (Error error, GeoCoordinate location, String recipient)

A callback with the current location to be sent to the specified recipient or requesting the specified recipient for his/her current location through SMS.

Interface Details

The send location event listener interface

Method Details

public abstract void onSendLocation (Error error, GeoCoordinate location, String recipient)

A callback with the current location to be sent to the specified recipient or requesting the specified recipient for his/her current location through SMS. e.g. "Send my location to mom", "where is my mom" Notes:

  • This feature requires Contacts, Location, and SMS permissions from the users.
  • Contacts are loaded once during NLP initialization into memory. Any changes made thereafter will not be reflected until the next startup.
  • Contact's display name and nickname are used for recipient lookup. For example, for "send my location to mom" use case to work, user needs have a contact with display name "mom" or nickname "mom".
  • Levenshtein distance is used for recipient lookup with fault tolerance of 1 character. For example, if a contact has nickname, "mum", it will be matched to recipient "mom".
  • If the specified recipient is matched to multiple contacts, the first matched contact will be used and the first match may not be the best match. For example, first match is "mum" and second match is "mom" and the specified recipient is "mom", the first match will be used even though it's not the best match.
  • Recipient lookup is limited to contacts on the device. For utterances like "publish my location to facebook" or "publish my location to twitter" will result in an attempt to send location through SMS to a contact named "facebook" or "twitter" respectively. For another example, "send my location to myself" will result in an attempt to send a SMS to a contact named "myself".

Parameters:

  • error

    NONE if location information is successfully sent/requested; otherwise FAILED

  • location

    The current location for sending request; otherwise null.

  • recipient

    Recipient of the SMS.