User Tools

Site Tools


android:agtek_lib_location_manager_architecture

This is an old revision of the document!


Overview

The following pseudo-UML diagram details the basic structure of the LocationManager framework. The LocationManager framework is composed of the following classes:

  • LocationManager - The main class used by the application/activity
  • LocationDevice - The abstract class which represents all device descriptors
  • LocationProvider - The abstract class which represents all location providers
  • LocationException - The root of all exceptions thrown by a location provider
  • GPXWriter - Functionality to record streams of locations as a GPX file
  • DeviceException - The root of all exceptions thrown by LocationDevice operations

The framework also provides the following devices and providers:

  • BuiltInGPSDevice/BuiltInGPSProvider - Interface for the Android built in GPS
  • PlaybackDevice/PlaybackProvider - Interface to playback locations from a previously recorded GPX file.

A LocationDevice provides a device Name (human readable) map to the Provider (via getProviderInstance() method). During normal operations, the Application/Activity asks the LocationManager for a list of known providers. The Application/Activity displays those to the user, or makes a choice (somehow). Once the LocationDevice is chosen, the Application then requests updates. The LocationManager will create and manage an instance of the LocationProvider, as needed. The application does not need to be involved in Provider management.

Extending the framework

Adding new devices is relatively straight forward. For each new device you must write a new class to be the LocationDevice and write a new class to be the LocationProvider. It is up to the Device to perform detection and verification of the ohysical device, while the Provider is to provide the normalized location updates when they are made available via the physical device.

If the instrument being added is a Bluetooth device, the you should extend com.agtek.location.bluetooth.AbstractBluetoothDevice instead of the normal LocationDevice and the Provider should extend com.agtek.location.bluetooth.AbstractBluetoothProvider. These classes serve to combine common Bluetooth functionality and data needed across all Bluetooth devices.

android/agtek_lib_location_manager_architecture.1301417264.txt.gz · Last modified: 2012/10/10 17:17 (external edit)