Motorola i88s manual PositionConnection Class, Almanac Out Of Date, Example

Page 7

Motorola Inc.

i88s J2ME Developers’ Guide

ALMANAC Out Of Date

After permission is granted, the Java API will bring up a system screen to prompt the user if the Almanac data in the phone is out of date or invalid, and the phone is not provisioned for packet data service. This is done only once after the phone powers up. If the user gives permission to override Almanac data, the Java API will try to retrieve position data. If user does not grant the Almanac override, the Java API will return the position with its attributes

set to UNAVAILABLE and the status of PositionConnection set to

POSITION_RESPONSE_NO_ALMANAC_OVERRIDE.

1.3PositionConnection Class

This interface supports the creation of a connection to the GPS receiver (driver). GPS position can be retrieved and status can be obtained after creating a connection. Only one connection is allowed at a time. This API must be called from a separate thread from the main application thread.

To get a PositionConnection, the MIDlet must use the generic Connector class.

Example

com.motorola.iden.PositionConnection sc = (com.motorola.iden.PositionConnection)Connector.open(String name);

String name should be one of the following:

name = “mposition:delay=no”

name = ”mposition:delay=low”

name = ”mposition:delay=high”

delay=no

This option has been designed to provide the cell latitude and longitude to an application immediately after it requests them. Because all other attributes in the AggregatePosition class may be set to UNAVAILABLE, an application should use this connection only to access the cell latitude and longitude. This request does not make use of the GPS chipset. If the handset is outside of the network coverage area, the cell latitude and longitude will be set to 0.

delay=low

This option provides a response to the application in a few seconds. New assist data is retrieved only if no assist data exists or if the assist data is older than the Maximum Assist Data Age (MADA). This operation is transparent to the application. This option is designed to provide all the position attributes with assistance from the Location Enhanced Service (LES) Server. To exercise this option, the device needs to have packet data service. Currently the maximum response time for this type of request is 32 seconds. If the API times out, the position will be returned with appropriate status and error code. If a low-delay request is made outside of the network coverage area, then the API will not get the assist data from the LES. The fix will proceed without assist data, and the timeout will remain at the low-delay value of 32 seconds.

Version 1.0 - Page 7

Image 7
Contents I88s Multi-Communication Device J2ME Developers’ Guide J2ME Networking Disclaimer Document OverviewAcronyms and Definitions Contact InformationAcronyms Used In This Guide Terminology Definition Overview Agps On The i88s PhoneAccuracy Position APIAssist Data Almanac Out Of Date PositionConnection ClassExample GetPositionString name Method DescriptionsRetrieving Position in Java GetPositionGetStatus Using Position in JavaExample Using PositionConnection Positionresponsenoalmanacoverride Addition, to obtain better accurate speed and direction Recommendation Http Https J2ME NetworkingClass Descriptions Https HttpSupported Protocols on the i88s Phone SSL Secure Sockets TCP SocketsServerSockets UDP Sockets Serial Port AccessCommunicating on a Port Connection Optional ParametersImplementation Notes Example using StreamConnectionConcurrent Connections For The i88s Phone Protocol Maximum TipsClass Description File I/OMethod Descriptions Opening a file Reading and Writing Deleting a fileCode 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