Motorola i88s manual Using Position in Java, GetStatus

Page 9

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

Image 9
Contents I88s Multi-Communication Device J2ME Developers’ Guide J2ME Networking Disclaimer Document OverviewContact Information Acronyms and DefinitionsAcronyms Used In This Guide Terminology Definition Overview Agps On The i88s PhonePosition API AccuracyAssist Data PositionConnection Class Almanac Out Of DateExample Retrieving Position in Java Method DescriptionsGetPosition GetPositionString nameGetStatus Using Position in JavaExample Using PositionConnection Positionresponsenoalmanacoverride Addition, to obtain better accurate speed and direction Recommendation Http Https J2ME NetworkingClass Descriptions Http HttpsSupported Protocols on the i88s Phone TCP Sockets SSL Secure SocketsServerSockets UDP Sockets Serial Port AccessCommunicating on a Port Connection Optional ParametersImplementation Notes Example using StreamConnectionConcurrent Connections For The i88s Phone Protocol Maximum TipsFile I/O Class DescriptionMethod Descriptions Opening a file Deleting a file Reading and WritingCode Examples Example # 2 Complete MIDlet code Motorola Inc I88s J2ME Developers’ Guide Os = sc.openOutputStream //get InputStream Sc.close Caveats Motorola Inc I88s J2ME Developers’ Guide
Related manuals
Manual 43 pages 17.94 Kb