blackberry.location

Availability

BlackBerry Device Software version 4.1 or later

The blackberry.location object is a property of the blackberry object. It provides access to the GPS location of the BlackBerry device. The GPS location refers to the geographical co-ordinates, latitude and longitude, of the BlackBerry device.

Properties

Property name

Type

Description

Status

Availability

GPSSupported

boolean

When true, this property indicates that GPS positioning is supported by the BlackBerry device.

read only

4.1 or later

latitude

double

Returns the current latitude, in degrees, of the BlackBerry device. Positive values indicate northern latitude, negative values indicate southern latitude.

To ensure that the most accurate co-ordinate is returned, you should register a listener using blackberry.location.onLocationUpdate() and acquire the location information within the callback.

read only

4.1 or later

longitude

double

Returns the current longitude, in degrees, of the BlackBerry device. Positive values indicate eastern longitude, negative values indicate western longitude.

To ensure that the most accurate co-ordinate is returned, you should register a listener using blackberry.location.onLocationUpdate() and read acquire the location information within the callback.

read only

4.1 or later

timestamp

unsigned long

Returns time (in milliseconds since epoch) at which the blackberry.location object was updated.

This property is only supported on BlackBerry devices running BlackBerry Device Software version 4.6 or later.

read only

4.6 or later

Methods

Method name

Description

Availability

onLocationUpdate()

Registers a callback method that is called when the location is updated using blackberry.location.refreshLocation().

4.1 or later

refreshLocation()

Requests an update of the location of the BlackBerry device.

4.1 or later

removeLocationUpdate()

Removes a previously registered callback method.

4.6 or later

setAidMode()

Specifies which method the BlackBerry device will use to obtain the GPS location.

4.1 or later

Last modified: 2014-03-10



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus