Settings API

This page details all of the available NEON API functionality contained within the static API class NeonSettings.

Providing Credentials

To enter credentials you can call the NEON Login Activity. This will allow the user to enter a user name and password or sign in with a Google account.

Generally, an application should call this function when it receives an Authentication event with type NO_CREDENTIALS_SET. The user will need to enter credentials into the NEON login activity. A request code can be returned to the calling activity to indicate whether the user exited without entering credentials. The NEON Location Service will indicate that it has successfully logged in with an Authentication event of type SUCCESS. Before this event, API functions which require a login will fail.

boolean startLoginActivityForResult(int requestCode, Activity visibleActivity)

If an API Authentication Key has been generated for your subscription, you can supply that instead with the login() function.

void login(String apiKey)
void login(String apiKey, String endPoint)

If you are logging into the public NEON Cloud, just supply the API Authentication Key (which can be generated by an administrator on the NEON website). If you’re logging into a NEON Enterprise server, provide the server location (https://) as well as the API Key.

You can retrieve login information, including what server you are connected to, the username, and the node ID, with getLoginInfo().

NeonAccount getLoginInfo()

Selecting a NEON Tracking Unit

NEON Location Service needs a selected tracking unit in order to start tracking and acquire a location. To check whether a tracking unit has been selected, call NeonSettings.hasTrackingUnit(). In order to bring up the tracker selection activity, call NeonSettings.startTrackingUnitActivityForResult(), which will launch an activity to guide the user in connecting to a tracking unit.

boolean hasTrackingUnit()
boolean startTrackingUnitActivityForResult(Activity visibleActivity, int requestCode)

To set a tracking unit without calling the activity above, provide the bluetooth address of a tracking unit.

void setAndEnableTrackingUnit(String btAddress)

You can also retrieve the current name and bluetooth address of the connected tracking unit.

String getTrackingUnitAddress()
String getTrackingUnitName()

Selecting internal sensors

NEON Location Service, given the required permissions, can use the internal sensors on the Android device for tracking. Currently this requires a feature on you subscription (contact support to enable this), a phone with HiFi sensors of API23 or greater, and battery optimization turned off for NEON Location Services. Without these things tracking will fail to start.

To check whether your subscription has permission for internal sensors and your phone supports them, call canEnableInternalSensors() after you have authenticated.

boolean canEnableInternalSensors(Context context)

At this point you should be able to set and enable internal sensors for the phone. In order to track with internal sensors, battery optimizations must be disabled for NEON Location Service. To check whether battery optimization is disabled, call IsIgnoringBatteryOptimizations() and to prompt the user to disable them, call startIgnoreBatteryOptimizationsActivity()

boolean isIgnoringBatteryOptimizations(Context context)
boolean startIgnoreBatteryOptimizationsActivity(Activity visibleActivity)

If canEnableInternalSensors() and isIgnoringBatteryOptimizations() both return true, you can start tracking with internal sensors with:

boolean setAndEnableInternalSensors(Context context)

Beacon Update Utility

NEON can update beacons remotely with the Beacon Update Utility. You can open the activity with:

void startBeaconUpdateUtility(Activity visibleActivity)

Updating the NEON Location Service

If there is an available update, calling Neon.upgradeNeonLocationServices() will launch an activity that will download and install the latest version of the NEON Location Service. This only needs to be called when an UpdateAvailableEvent or MandatoryUpdateAvailableEvent is received. Note that if you upgrade the NEON Location Service while bound, the service will be forced to unbind. A binding event of type FATAL_DISCONNECT will be received, and you should unbind and unregister listeners on that event. Once the new version is installed, you can rebind to Neon.

The NEON Location Service is updated regularly, and upgrades are not required for continued operation. However, a MandatoryUpdateAvailable event means that the NEON Location Service is no longer compatible with the current version of the NEON API, and upgrade is required for continued use. To present the user with a mandatory update, set mandatoryUpdate to true.

void upgradeNeonLocationServices(Activity visibleActivity)
void upgradeNeonLocationServices(Activity visibleActivity, int requestCode, boolean mandatoryUpdate)

You can retrieve the current version of the NEON Location service with:

String getNeonLocationServicesVersion(Context context)

Configuring an UWB Network

If you tracking unit has ultra-wideband, you can set up a network for constraint sharing and dropped beacons. To determine if your tracking unit has ultra-wideband, use:

boolean hasUWBSensors()

You can retrieve the current UWB configuration using getUWBConfiguration() and set it with setUWBConfiguration().

boolean setUWBConfiguration(UWBChannelConfig channelConfig)
UWBChannelConfig getUWBConfiguration()

Android GPS Settings

By default, NEON Location Services will use Android-provided GPS locations to improve location. If GPS is unreliable and you wish to use only inertial and beacons to determine location, you can disable Android GPS enableAndroidGPS() and check the status with isAndroidGPSEnabled()

void enableAndroidGPS(boolean useGPS)
boolean isAndroidGPSEnabled()

Notification Settings

By default, NEON Location Services provides a status notification in the Android top bar tha displays tracking status and brings you to the NEON settings page if clicked. For those integrators that want the NEON Location Services to be as minimal as possible, call hideStatusInformation(). There must always be a notification in the top bar in order for tracking to work, but this will show only a small icon and the application name and won’t open the settings activity when pressed.

void minimizeStatusNotification(boolean minimize)
boolean isStatusNotificationMinimized()