Package com.trx.neon.api.neon
Class Neon
- java.lang.Object
-
- com.trx.neon.api.neon.Neon
-
public class Neon extends java.lang.Object
The main entry point for integrating Neon Location Services into your application.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTIVITY_START_ON_TOUCH_PAIR
Register an intent filter for this action to have your UI be started when the user touch pairs a tracking unitstatic java.lang.String
NEON_READY_ON_TOUCH_PAIR
Neon location service is paired and ready to run
-
Constructor Summary
Constructors Constructor Description Neon()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
bind(android.content.Context c)
Binds the Neon Location Services, ensuring that tracking is running and connecting all registered listeners All events will be posted to the main application thread.static boolean
bind(android.content.Context c, android.os.Handler eventHandler)
Binds the Neon Location Services, ensuring that tracking is running and connecting all registered listeners All registered events will be posted to the specified handler.static boolean
hasRequiredPermissions(android.content.Context context)
Checks whether NEON Location Service has been granted the required app permissionsstatic boolean
isBound()
Return true if the Neon Service is bound and runningstatic boolean
isNeonInstalled(android.content.Context c)
Checks if the Neon Service is already installed Return true if the Neon Service package was foundstatic void
registerEvents(INeonEventListener listener)
Register a listener for events of all typesstatic void
registerLocationUpdates(INeonLocationListener listener)
Register a named listener for CURRENT location updates.static void
registerLocationUpdates(INeonLocationListener listener, NeonLocationType type)
Register a named listener for location updates of the specified typestatic boolean
startPermissionActivityForResult(android.app.Activity visibleActivity, int requestCode)
Interact with the user to grant required app permissions to NEON Location Servicestatic void
unbind()
Unbinds the Neon Location Services.static boolean
unregisterEvents(INeonEventListener listener)
Unregister a previously registered listenerstatic boolean
unregisterLocationUpdates(INeonLocationListener listener)
Unregister a previously registered listener
-
-
-
Field Detail
-
ACTIVITY_START_ON_TOUCH_PAIR
public static final java.lang.String ACTIVITY_START_ON_TOUCH_PAIR
Register an intent filter for this action to have your UI be started when the user touch pairs a tracking unit- See Also:
- Constant Field Values
-
NEON_READY_ON_TOUCH_PAIR
public static final java.lang.String NEON_READY_ON_TOUCH_PAIR
Neon location service is paired and ready to run- See Also:
- Constant Field Values
-
-
Method Detail
-
bind
public static boolean bind(android.content.Context c)
Binds the Neon Location Services, ensuring that tracking is running and connecting all registered listeners All events will be posted to the main application thread. Returns true if Neon was successfully bound, false otherwise
-
bind
public static boolean bind(android.content.Context c, android.os.Handler eventHandler)
Binds the Neon Location Services, ensuring that tracking is running and connecting all registered listeners All registered events will be posted to the specified handler. Returns true if Neon was successfully bound, false otherwise
-
unbind
public static void unbind()
Unbinds the Neon Location Services. If this context is the last to unbind, then tracking will cease. All registered listeners will be disconnected until the next bind call, Events that have already been queued will continue to be processed, even after this function returns.
-
registerLocationUpdates
public static void registerLocationUpdates(INeonLocationListener listener)
Register a named listener for CURRENT location updates.
-
registerLocationUpdates
public static void registerLocationUpdates(INeonLocationListener listener, NeonLocationType type)
Register a named listener for location updates of the specified type
-
unregisterLocationUpdates
public static boolean unregisterLocationUpdates(INeonLocationListener listener)
Unregister a previously registered listener- Returns:
- true if listener was removed, false if it could not be found
-
registerEvents
public static void registerEvents(INeonEventListener listener)
Register a listener for events of all types
-
unregisterEvents
public static boolean unregisterEvents(INeonEventListener listener)
Unregister a previously registered listener- Returns:
- true if listener was removed, false if it could not be found
-
isNeonInstalled
public static boolean isNeonInstalled(android.content.Context c)
Checks if the Neon Service is already installed Return true if the Neon Service package was found
-
isBound
public static boolean isBound()
Return true if the Neon Service is bound and running
-
startPermissionActivityForResult
public static boolean startPermissionActivityForResult(android.app.Activity visibleActivity, int requestCode)
Interact with the user to grant required app permissions to NEON Location Service- Parameters:
visibleActivity
- A resumed Activity context used to start the interactionrequestCode
- onActivityResult will be called this requestCode- Returns:
- true if the activity was started successsfully
-
hasRequiredPermissions
public static boolean hasRequiredPermissions(android.content.Context context)
Checks whether NEON Location Service has been granted the required app permissions- Parameters:
context
- A context for permissions checking- Returns:
- true if permissions have been granted, false otherwise
-
-