Class 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 unit
      static 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 permissions
      static boolean isBound()
      Return true if the Neon Service is bound and running
      static boolean isNeonInstalled​(android.content.Context c)
      Checks if the Neon Service is already installed Return true if the Neon Service package was found
      static void registerEvents​(INeonEventListener listener)
      Register a listener for events of all types
      static 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 type
      static boolean startPermissionActivityForResult​(android.app.Activity visibleActivity, int requestCode)
      Interact with the user to grant required app permissions to NEON Location Service
      static void unbind()
      Unbinds the Neon Location Services.
      static boolean unregisterEvents​(INeonEventListener listener)
      Unregister a previously registered listener
      static boolean unregisterLocationUpdates​(INeonLocationListener listener)
      Unregister a previously registered listener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • Neon

        public Neon()
    • 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 interaction
        requestCode - 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