Class Meridian
This class’s static configure method must be called to initialize the SDK.
By using the Meridian SDK, you hereby agree to the terms of the Meridian SDK License at https://edit.meridianapps.com/users/sdk_tac
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
Exception that indicates when there has been a configuration error when initializing the Meridian SDK. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Configure Meridian instance, this can only be run once.Get the base uri for the sdk’s api callsGet the version of the Meridian API utilized by the SDK.int
Get the interval in seconds between bluedot computations.int
Returns the threshold for number of buildings to decide between the old vs.long
Get the timeout in milliseconds to use when overriding cache headers provided by the server.Get custom headers for HTTP requests.Get the default max map zoom.Get the stored Meridian Editor token.int
Get the interval in seconds between location sharing updates while in the background.int
Get the interval in seconds between location sharing updates while in the foreground.int
Get the logcat reporting level.int
Get the delay (in milliseconds) before the orientation warning is set/cleared.int
Get the degree threshold from the routing line that triggers a warning.Get the PackageInfo for this application.com.android.volley.RequestQueue
Get the request queue used by all Meridian API calls.long
Get the delay before rerouting is triggered.long
Get the distance threshold in meters for rerouting.long
Get the snap threshold in meters for snapping generated locations to the route line while routing.Get the build date of the Meridian SDKGet the version of the Meridian SDKint
Get the version code of the Meridian SDKstatic Meridian
float
When using system-provided services for outdoor location, readings will only be considered valid with an accuracy of at least this value in meters.boolean
boolean
boolean
boolean
void
setAPIBaseUri
(Uri baseUri) Internal API for using development version of the editorvoid
setAutoAdvanceRoutes
(boolean autoAdvance) Enable/Disable auto advancing steps using location information during routing.void
setBluedotComputationInterval
(int intervalSeconds) Set the interval in seconds between bluedot computations.void
setBuildingsThreshold
(int buildingsThreshold) Set the number of buildings threshold.void
setCacheOverrideTimeout
(long timeOut) Set the timeout in milliseconds to use when overriding cache headers provided by the server.void
setCustomHttpHeaders
(Map<String, String> httpHeaders) Set custom headers to HTTP requests.void
setDefaultMaxMapZoom
(MapInfo.ZoomLevel defaultMaxMapZoom) Set the default max map zoom.void
setDomainRegion
(Meridian.DomainRegion region) Set the Domain Region to either EU/US.void
setEditorToken
(String editorToken) Set the Meridian Editor token.void
setForceSimulatedLocation
(boolean forceSimulatedLocation) Enable/Disable forcing the use of the simulated location from the server rather than generated locations.void
setLocationSharingBackgroundJobInterval
(int intervalSeconds) Set the interval in seconds between location sharing updates while in the background.void
setLocationSharingForegroundJobInterval
(int intervalSeconds) Set the interval in seconds between location sharing updates while in the foreground.void
setLogLevel
(int newLevel) Set the logcat reporting level using android.util.Log values.void
setMapPickerHighestFloorOnTop
(boolean mapPickerHighestFloorOnTop) Sets the order of the floors on map picker which is either sorted from highest to lowest or the opposite.void
setMapPickerSearchBarEnabled
(boolean enableMapPickerSearch) Enables or disables search bar for map picker with PICKER_SEARCH picker style.void
setOrientationWarningDelay
(int milliseconds) When the compass is poorly aligned to the routing line, a warning is displayed after a certain amount of time.void
setOrientationWarningThreshold
(int degrees) The compass orientation is considered correct when it’s aligned to the routing line.void
setOverrideCacheHeaders
(boolean override) Set the SDK to override the server provided cache headers with the cache override timeout.void
setPickerStyle
(LevelPickerControl.PickerStyle pickerStyle) void
setRerouteDelay
(long rerouteDelay) Set the delay before rerouting is triggered.void
setRerouteDistance
(long rerouteDistance) Set the distance threshold for rerouting.void
setRouteSnapDistance
(long defaultSnapDistance) Set the snap threshold in meters for snapping generated locations to the route line while routing.void
setRSSICorrection
(boolean useRSSICorrection, boolean override) Enable/Disable if RSSI correction will be used.void
setShowCompass
(boolean showCompass) Enable/Disable the visibility of the compass arrow on the blue dot.void
setShowTags
(boolean showTags) Indicate if Tags should be shown.void
setShowUnpublishedMaps
(boolean showUnpublishedMaps) Enable/Disable if SDK APIs will also include maps that have not been marked published by the Editor.void
setSystemLocationAccuracyThreshold
(float systemLocationAccuracyThreshold) Set the system-provided services accuracy threshold.void
setTagsBaseRestUri
(Uri tagsBaseRestUri) Internal API for using development version of the editorvoid
setTagsBaseUri
(Uri tagsBaseUri) Internal API for using development version of the editorvoid
setTextFont
(Typeface font, Typeface semiBoldFont, Typeface boldFont) Set the regular, semi-bold, and bold fonts for text.void
setUseWifiLocation
(Context context, boolean useWifiLocation) Enable/Disable use of wifi location (also known as FTM, RTT or 802.11mc)boolean
Indicates if the SDK will auto advance routes when a devices location moves along them.boolean
Indicates if the SDK will force the use of the simulated location from the server rather than generated locations.boolean
Indicates if the Cache headers of cache-able API requests are being overridden by the cache override timeout.boolean
Indicates if the SDK will use wifi location (also known as FTM, RTT or 802.11mc) to compute location.boolean
Get if blue dot should be shown (SUB1-BLUE-100).boolean
Indicates if the SDK will show the compass arrow on the blue dot.boolean
showMaps()
Get if maps should be shown (SUB1-MAPS-100).boolean
showTags()
Get if Tags should be shown (SUB1-TAGS-100).boolean
Indicates if SDK APIs will also include maps that have not been marked published by the Editor.void
supportDarkTheme
(boolean supportDarkTheme) Enables support for dark theme.void
supportGPSOnly
(boolean supportGPSOnly) Enables support for GPS only location.boolean
Indicates if RSSI correction will be used.
-
Method Details
-
configure
Configure Meridian instance, this can only be run once.- Throws:
Meridian.MeridianConfigurationException
- if invalid context or already initialized
-
getSDKVersion
Get the version of the Meridian SDK -
getSDKVersionCode
public int getSDKVersionCode()Get the version code of the Meridian SDK -
getSDKBuildDate
Get the build date of the Meridian SDK -
getAPIVersion
Get the version of the Meridian API utilized by the SDK. -
getEditorToken
Get the stored Meridian Editor token. -
setEditorToken
Set the Meridian Editor token. -
getRequestQueue
public com.android.volley.RequestQueue getRequestQueue()Get the request queue used by all Meridian API calls. -
getPackageInfo
Get the PackageInfo for this application. -
getAPIBaseUri
Get the base uri for the sdk’s api calls -
setAPIBaseUri
Internal API for using development version of the editor -
getTagsBaseUri
-
setTagsBaseUri
Internal API for using development version of the editor -
getTagsBaseRestUri
-
setTagsBaseRestUri
Internal API for using development version of the editor -
setDomainRegion
Set the Domain Region to either EU/US.Primarily a convenience method for initialization using the SDK
-
shouldOverrideCacheHeaders
public boolean shouldOverrideCacheHeaders()Indicates if the Cache headers of cache-able API requests are being overridden by the cache override timeout. -
setOverrideCacheHeaders
public void setOverrideCacheHeaders(boolean override) Set the SDK to override the server provided cache headers with the cache override timeout. -
getCacheOverrideTimeout
public long getCacheOverrideTimeout()Get the timeout in milliseconds to use when overriding cache headers provided by the server. -
setCacheOverrideTimeout
public void setCacheOverrideTimeout(long timeOut) Set the timeout in milliseconds to use when overriding cache headers provided by the server. -
shouldAutoAdvanceRoutes
public boolean shouldAutoAdvanceRoutes()Indicates if the SDK will auto advance routes when a devices location moves along them. -
setAutoAdvanceRoutes
public void setAutoAdvanceRoutes(boolean autoAdvance) Enable/Disable auto advancing steps using location information during routing. -
shouldForceSimulatedLocation
public boolean shouldForceSimulatedLocation()Indicates if the SDK will force the use of the simulated location from the server rather than generated locations. -
setForceSimulatedLocation
public void setForceSimulatedLocation(boolean forceSimulatedLocation) Enable/Disable forcing the use of the simulated location from the server rather than generated locations. -
shouldUseWifiLocation
public boolean shouldUseWifiLocation()Indicates if the SDK will use wifi location (also known as FTM, RTT or 802.11mc) to compute location. -
setUseWifiLocation
Enable/Disable use of wifi location (also known as FTM, RTT or 802.11mc) -
setPickerStyle
-
getPickerStyle
-
showCompass
public boolean showCompass()Indicates if the SDK will show the compass arrow on the blue dot. -
setShowCompass
public void setShowCompass(boolean showCompass) Enable/Disable the visibility of the compass arrow on the blue dot. -
showUnpublishedMaps
public boolean showUnpublishedMaps()Indicates if SDK APIs will also include maps that have not been marked published by the Editor. -
setShowUnpublishedMaps
public void setShowUnpublishedMaps(boolean showUnpublishedMaps) Enable/Disable if SDK APIs will also include maps that have not been marked published by the Editor. -
useRSSICorrection
public boolean useRSSICorrection()Indicates if RSSI correction will be used.This adjusts the received signal strength based on hardware type.
-
setRSSICorrection
public void setRSSICorrection(boolean useRSSICorrection, boolean override) Enable/Disable if RSSI correction will be used.This adjusts the received signal strength based on hardware type.
- Parameters:
useRSSICorrection
- If RSSI correction should be used.override
- If the server side value should be overridden - set true to force RSSI correction.
-
getDefaultMaxMapZoom
Get the default max map zoom. -
setDefaultMaxMapZoom
Set the default max map zoom. -
getRouteSnapDistance
public long getRouteSnapDistance()Get the snap threshold in meters for snapping generated locations to the route line while routing. -
setRouteSnapDistance
public void setRouteSnapDistance(long defaultSnapDistance) Set the snap threshold in meters for snapping generated locations to the route line while routing. -
getRerouteDistance
public long getRerouteDistance()Get the distance threshold in meters for rerouting. -
setRerouteDistance
public void setRerouteDistance(long rerouteDistance) Set the distance threshold for rerouting. -
getRerouteDelay
public long getRerouteDelay()Get the delay before rerouting is triggered. -
setRerouteDelay
public void setRerouteDelay(long rerouteDelay) Set the delay before rerouting is triggered. -
getOrientationWarningThreshold
public int getOrientationWarningThreshold()Get the degree threshold from the routing line that triggers a warning. -
setOrientationWarningThreshold
public void setOrientationWarningThreshold(int degrees) The compass orientation is considered correct when it’s aligned to the routing line.When the compass is poorly aligned to the routing line, a warning is displayed. Sets the threshold in degrees at which a poor compass alignment triggers a warning. Acceptable range is 45 to 90 degrees.
- Parameters:
degrees
- degree threshold at which the compass is considered poorly aligned.
-
getOrientationWarningDelay
public int getOrientationWarningDelay()Get the delay (in milliseconds) before the orientation warning is set/cleared. -
setOrientationWarningDelay
public void setOrientationWarningDelay(int milliseconds) When the compass is poorly aligned to the routing line, a warning is displayed after a certain amount of time.Sets the delay before the warning is set or cleared. Acceptable delay is 2000 to 10,000 milliseconds.
- Parameters:
milliseconds
- time before the orientation warning is set or removed (in milliseconds)
-
getBluedotComputationInterval
public int getBluedotComputationInterval()Get the interval in seconds between bluedot computations. -
setBluedotComputationInterval
public void setBluedotComputationInterval(int intervalSeconds) Set the interval in seconds between bluedot computations.Minimum value is 2, the default value is 4.
-
getLocationSharingForegroundJobInterval
public int getLocationSharingForegroundJobInterval()Get the interval in seconds between location sharing updates while in the foreground. -
setLocationSharingForegroundJobInterval
public void setLocationSharingForegroundJobInterval(int intervalSeconds) Set the interval in seconds between location sharing updates while in the foreground.Minimum value is 2, the default value is 20. Note that this is not guaranteed to be honored by the OS. More frequent intervals may negatively affect battery life.
-
getLocationSharingBackgroundJobInterval
public int getLocationSharingBackgroundJobInterval()Get the interval in seconds between location sharing updates while in the background. -
setLocationSharingBackgroundJobInterval
public void setLocationSharingBackgroundJobInterval(int intervalSeconds) Set the interval in seconds between location sharing updates while in the background.Minimum value is 30, the default value is 60. Note that this is not guaranteed to be honored by the OS and will be overridden by OS doze minimums. More frequent intervals may negatively affect battery life.
-
setCustomHttpHeaders
Set custom headers to HTTP requests.Reserved for Meridian use
- Parameters:
httpHeaders
- headers to be added
-
getCustomHttpHeaders
Get custom headers for HTTP requests. -
getSystemLocationAccuracyThreshold
public float getSystemLocationAccuracyThreshold()When using system-provided services for outdoor location, readings will only be considered valid with an accuracy of at least this value in meters. -
setSystemLocationAccuracyThreshold
public void setSystemLocationAccuracyThreshold(float systemLocationAccuracyThreshold) Set the system-provided services accuracy threshold.Defaults to 10.
-
getBuildingsThreshold
public int getBuildingsThreshold()Returns the threshold for number of buildings to decide between the old vs.new level-picker UI
-
setBuildingsThreshold
public void setBuildingsThreshold(int buildingsThreshold) Set the number of buildings threshold.Defaults to 20.
-
isMapPickerHighestFloorOnTop
public boolean isMapPickerHighestFloorOnTop()- Returns:
- true if the map picker’s order is highest to lowest floors or false if it’s the opposite.
-
setMapPickerHighestFloorOnTop
public void setMapPickerHighestFloorOnTop(boolean mapPickerHighestFloorOnTop) Sets the order of the floors on map picker which is either sorted from highest to lowest or the opposite.- Parameters:
mapPickerHighestFloorOnTop
- indicates if map picker should display highest to lowest floors or the opposite.
-
isMapPickerSearchEnabled
public boolean isMapPickerSearchEnabled()- Returns:
- true if search bar is enabled for map picker with PICKER_SEARCH picker style, false otherwise.
-
setMapPickerSearchBarEnabled
public void setMapPickerSearchBarEnabled(boolean enableMapPickerSearch) Enables or disables search bar for map picker with PICKER_SEARCH picker style.NOTE: Search bar can be disabled only if there are less than 10 buildings each with less than 10 floors.
- Parameters:
enableMapPickerSearch
- indicates if search bar should be enabled or not.
-
isDarkThemeSupported
public boolean isDarkThemeSupported()- Returns:
- Returns if dark theme support is enabled in the app.
-
supportDarkTheme
public void supportDarkTheme(boolean supportDarkTheme) Enables support for dark theme.Note that dark theme is currently available on Android 10 and higher.
- Parameters:
supportDarkTheme
- indicates if dark theme support should be enabled.
-
isGPSOnly
public boolean isGPSOnly()- Returns:
- Returns if GPS only support is enabled in the app.
-
supportGPSOnly
public void supportGPSOnly(boolean supportGPSOnly) Enables support for GPS only location.This disables checking if bluetooth is enabled. Recommended to be false (the default), unless the location uses GPS exclusively
- Parameters:
supportGPSOnly
- indicates if the location uses GPS exclusively.
-
setTextFont
Set the regular, semi-bold, and bold fonts for text.NOTE: Both Android built-in fonts and custom fonts can be set.
- Parameters:
font
- font to be set. By default, open_sans_regular is used.semiBoldFont
- semi-bold font to be set. By default, open_sans_semibold is used.boldFont
- bold font to be set. By default, open_sans_bold is used.
-
getTextFont
- Returns:
- Returns the text font.
-
getTextSemiBoldFont
- Returns:
- Returns the text semi-bold font.
-
getTextBoldFont
- Returns:
- Returns the text bold font.
-
setLogLevel
public void setLogLevel(int newLevel) Set the logcat reporting level using android.util.Log values.Defaults to android.util.Log.VERBOSE.
-
getLogLevel
public int getLogLevel()Get the logcat reporting level. -
showMaps
public boolean showMaps()Get if maps should be shown (SUB1-MAPS-100). -
showBlueDot
public boolean showBlueDot()Get if blue dot should be shown (SUB1-BLUE-100). -
showTags
public boolean showTags()Get if Tags should be shown (SUB1-TAGS-100). -
setShowTags
public void setShowTags(boolean showTags) Indicate if Tags should be shown.