ketai.sensors

## Class KetaiLocation

- java.lang.Object
- - ketai.sensors.KetaiLocation

- All Implemented Interfaces:
    android.location.LocationListener

      public class KetaiLocation
      extends java.lang.Object
      implements android.location.LocationListener

  The KetaiLocation class provides android location services data to a sketch. To receive location data a sketch can define the following method:
  void onLocationEvent(Location l) : l is the raw android Location class
  void onLocationEvent(double lat, double lon) : lat, lon are the latitude & longitude in degrees
  void onLocationEvent(double lat, double lon, double alt) : lat, lon are the latitude & longitude in degrees, alt is altitude in meters
  void onLocationEvent(double lat, double lon, double alt. float acc) : lat, lon are the latitude & longitude in degrees, alt is altitude in meters, acc is the accuracy in meters

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KetaiLocation(processing.core.PApplet pParent)` Instantiates a new ketai location.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()`
    `Location` | `getLocation()` Gets the last location.
    `java.lang.String` | `getProvider()` Gets the location provider.
    `boolean` | `isStarted()` Checks if started.
    `java.util.Collection<? extends java.lang.String>` | `list()` Returns a list of Location providers
    `void` | `onLocationChanged(Location _location)`
    `void` | `onLocationChanged(android.location.Location arg0)`
    `void` | `onPermissionResult(boolean granted)` Handle permission request result
    `void` | `onProviderDisabled(java.lang.String arg0)`
    `void` | `onProviderEnabled(java.lang.String arg0)`
    `void` | `onStatusChanged(java.lang.String arg0, int arg1, android.os.Bundle arg2)`
    `void` | `post()`
    `void` | `register(java.lang.Object delegate)`
    `void` | `setUpdateRate(int millis, int meters)` Sets the update update rate based on time or distance traveled.
    `void` | `start()` Start services.
    `void` | `stop()` Stop.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KetaiLocation

          public KetaiLocation(processing.core.PApplet pParent)

      Instantiates a new ketai location.
      Parameters:
        `pParent` - the calling sketch/Activity/PApplet

  - ### Method Detail

    - #### onLocationChanged

          public void onLocationChanged(Location _location)

    - #### post

          public void post()

    - #### getLocation

          public Location getLocation()

      Gets the last location.
      Returns:
        the location

    - #### isStarted

          public boolean isStarted()

      Checks if started.
      Returns:
        true, if started

    - #### onPermissionResult

          public void onPermissionResult(boolean granted)

      Handle permission request result

    - #### start

          public void start()

      Start services.

    - #### stop

          public void stop()

      Stop. - clean resources

    - #### dispose

          public void dispose()

    - #### onProviderDisabled

          public void onProviderDisabled(java.lang.String arg0)

      Specified by:
        `onProviderDisabled` in interface `android.location.LocationListener`

    - #### onProviderEnabled

          public void onProviderEnabled(java.lang.String arg0)

      Specified by:
        `onProviderEnabled` in interface `android.location.LocationListener`

    - #### onStatusChanged

          public void onStatusChanged(java.lang.String arg0,
                                      int arg1,
                                      android.os.Bundle arg2)

      Specified by:
        `onStatusChanged` in interface `android.location.LocationListener`

    - #### getProvider

          public java.lang.String getProvider()

      Gets the location provider.
      Returns:
        the provider

    - #### list

          public java.util.Collection<? extends java.lang.String> list()

      Returns a list of Location providers
      Returns:
        the collection

    - #### setUpdateRate

          public void setUpdateRate(int millis,
                                    int meters)

      Sets the update update rate based on time or distance traveled.
      Parameters:
        `millis` - the millis
        `meters` - the meters

    - #### onLocationChanged

          public void onLocationChanged(android.location.Location arg0)

      Specified by:
        `onLocationChanged` in interface `android.location.LocationListener`

    - #### register

          public void register(java.lang.Object delegate)