Motorola Inc. | i88s J2ME Developers’ Guide |
•BATTERY_TOO_LOW – A constant to indicate that the battery is too weak to retrieve a fix.
•FIX_NOT_ATTAIN_ASSIST_DATA_UNAV – This constant indicates that the location fix has timed out because a fix is not attainable, and assist data is unavailable.
•FIX_NOT_ATTAINABLE – This constant indicates that the location fix has timed out because a fix is not attainable.
•GPS_CHIPSET_MALFUNCTION – This constant indicates that the GPS chipset is malfunctioning.
•UNAVAILABLE – This constant indicates that an unknown error has occurred. This is the default response code.
These response codes are used in conjunction with PositionConnection.getStatus() to determine the quality of the retrieved position. These values are only valid when either
POSITION_RESPONSE_ERROR or POSITION_RESPONSE_OK have been returned.
The following table shows possible response codes for these two values:
PositionConnection Status Values | Response Codes |
POSITION_RESPONSE_OK | POSITION_OK |
| ACCURACY_NOT_ATTAINABLE |
| ACC_NOT_ATTAIN_ASSIST_DATA_UNAV |
POSITION_RESPONSE_ERROR | FIX_NOT_ATTAINABLE |
| FIX_NOT_ATTAIN_ASSIST_DATA_UNAV |
| BATTERY_TOO_LOW |
| GPS_CHIPSET_MALFUNCTION |
| ALMANAC_OUT_OF_DATE, UNAVAILABLE |
1.3.2.2 getAssistanceUsed()
Applications can use the getAssistanceUsed() method to check if a fix has been retrieved using assistance.
1.3.3 Example – Using PositionConnection
void getViaPositionConnection() throws IOException { com.motorola.iden.PositionConnection c = null; String name = “mposition:delay=low”;
try{
c = (PositionConnection)Connector.open(name); AggregatePosition oap = c.getPosition();
//Returns the AggregatePosition which contains the position using the
//parameter passed when connection was opened.
//Application should only check status by calling getStatus() after
//getPosition() or getPosition(String name) returns,
//otherwise it returns the same status and is
//considered an invalid call of getStatus().
//check the status code for permission and almanac over ride if(c.getStatus() ==
Version 1.0 - Page 10