Motorola i88s manual Positionresponsenoalmanacoverride

Page 11

Motorola Inc.

i88s J2ME Developers’ Guide

com.motorola.iden.position.PositionConnection.POSITION_RESPONSE_RESTRICTED)

{

// means user has restricted permission to get position

}

else if(c.getStatus() == com.motorola.iden.position.PositionConnection.

POSITION_RESPONSE_NO_ALMANAC_OVERRIDE)

{

//means device has Almanac out of date and User has not granted to

override

}

else if(c.getStatus() == com.motorola.iden.position.PositionConnection. POSITION_NO_RESPONSE)

{

//means no response from device

}

if (oap != null ) { if(c.getStatus() ==

com.motorola.iden.position.PositionConnection.POSITION_RESPONSE_OK)

{

//Good position

//Check for any error from device on position

//Application needs to check for null position if(oap.getResponseCode() == PositionDevice.POSITION_OK) {

//no error in the position if(oap.hasLatLon()) {

//int value of Latitude and Longitude of the position in arc

//minutes multiplied by 100,000 to maintain accuracy or

//UNAVAILABLE if not available

int lat = oap.getLatitude(); int lon = oap.getLongitude();

//String representation of the Latitude and Longitude. String LATDEGREES = oap.getLatitude(Position2D.DEGREES); String LONGDEGREES = oap.getLongitude(Position2D.DEGREES);

}

if(oap.hasSpeedUncertainty()) {

//speed and heading value are valid int speed = oap.getSpeed();

if (hasTravelDirection()) {

// heading is available

int travelDirection = oap.getTravelDirection();

}

}

if(oap.hasAltitudeUncertainty()) {

int alt = oap.getAltitude(); //altitude of position in meters.

}

}

//handle the errors…or request again for good position

//or display message to the user.

else if(oap.getResponseCode() == PositionDevice.ACCURACY_NOT_ATTAINABLE) {

//the position information was provided but enough accuracy

//may not be attainable

}

else if(oap.getResponseCode() == PositionDevice.ACC_NOT_ATTAIN_ASSIST_DATA_UNAV) {

// the position information was provided but enough accuracy

Version 1.0 - Page 11

Image 11
Contents I88s Multi-Communication Device J2ME Developers’ Guide J2ME Networking Disclaimer Document OverviewAcronyms Used In This Guide Terminology Definition Contact InformationAcronyms and Definitions Overview Agps On The i88s PhoneAssist Data Position APIAccuracy Example PositionConnection ClassAlmanac Out Of Date 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 Supported Protocols on the i88s Phone HttpHttps ServerSockets TCP SocketsSSL Secure Sockets UDP Sockets Serial Port AccessCommunicating on a Port Connection Optional ParametersImplementation Notes Example using StreamConnectionConcurrent Connections For The i88s Phone Protocol Maximum TipsMethod Descriptions Opening a file File I/OClass Description Code Examples Deleting a fileReading and Writing 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