Motorola Inc.

i88s J2ME Developers’ Guide

getStatus()

This method returns the connection status response of the last location fix operation. This method should be called only after calling getPosition() or getPosition(String name). The obtained position information should be used only when getStatus() returns POSITION_RESPONSE_OK status code. The following is a list of returned responses for this method:

POSITION_NO_RESPONSE – This constant indicates that the device is not responding. No position information will be available, and all the attributes of the position will be set to UNAVAILABLE.

POSITION_RESPONSE_ERROR – This constant indicates that an error occurred while retrieving the position. If possible, the cell latitude and longitude will be available, but all position’s attributes will be set to UNAVAILABLE.

POSITION_RESPONSE_OK – This constant indicates that the obtained position is a valid position. All position’s attributes will be available.

POSITION_RESPONSE_RESTRICTED – This constant indicates that the user has set the device to not provide the position information. No position information will be available, and the position’s attributes will be set to UNAVAILABLE.

POSITION_WAITING_RESPONSE – This constant indicates that the API is waiting for a response from the position device. POSITION_WAITING_RESPONSE will be returned if getStatus() method is called before getPostion() method.

POSITION_RESPONSE_NO_ALMANAC_OVERRIDE - This constant indicates that the Almanac is outdated, and the user is restricted to override. No position information will be available, and all the attributes of the position will be set to UNAVAILABLE.

1.3.2Using Position in Java

1.3.2.1 getResponseCode()

Each position response has an associated response code. The getResponseCode() method in the AggregatePosition Interface allows an application to get the response code. The Application can use this response code to validate the position. The following is a list of returned response codes:

POSITION_OK – This constant indicates that the obtained position is valid and accurate.

ACC_NOT_ATTAIN_ASSIST_DATA_UNAV – This constant indicates that the location fix has timed out. The fix could not be accurately attained and assist data is not unavailable.

ALMANAC_OUT_OF_DATE – This constant indicates that the Almanac is out of date.

ACCURACY_NOT_ATTAINABLE – This constant indicates that the location fix has timed out, and the required accuracy is not attainable.

Version 1.0 - Page 9

Page 9
Image 9
Motorola i88s manual Using Position in Java, GetStatus