GPS code build errors - newbie question

I am getting build errors when running WTK 2.5.1

Trying to build the example code from MotoDev here:

http://developer.motorola.com/docstools/developerguides/GPS_Developer_Guidelines.pdf/

I am sure this is a very easy problem , but I am trying very hard as a newbie, but just can't figure this one out.

I have a feeling it has to do with this line....

"public class motoMidlet extends MIDlet{"

Code I have and WTK session result is below:

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import javax.microedition.location.*;

publicclass motoMidletextends MIDlet{

void getViaPositionConnection()throws IOException{

com.motorola.iden.PositionConnection c =null;

String name = 搈position: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() == com.motorola.iden.position.PositionConnection.POSITION_RESPONSE_RESTRICTED)

{

// means user has restricted permission to get position

}

elseif(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

}

elseif(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卭r request again for good position

// or display message to the user.

elseif(oap.getResponseCode() ==

PositionDevice.ACCURACY_NOT_ATTAINABLE){

// the position information was provided but enough accuracy

// may not be attainable

}

elseif(oap.getResponseCode() ==

PositionDevice.ACC_NOT_ATTAIN_ASSIST_DATA_UNAV){

// the position information was provided but enough accuracy

// assistant data unavailable

}

}// end of position response ok

elseif(c.getStatus() ==

com.motorola.iden.position.PositionConnection.POSITION_RESPONSE_ERROR)

{

// indicate an error occurred while getting the position

if(oap.getResponseCode() == PositionDevice.FIX_NOT_ATTAINABLE){

// means position information not provided (timeout)

}

elseif(oap.getResponseCode() ==

PositionDevice.FIX_NOT_ATTAIN_ASSIST_DATA_UNAV){

// means position information not provided (timeout) and

// assistant data unavailable

}

elseif(oap.getResponseCode() == PositionDevice.BATTERY_TOO_LOW){

// means battery is too low to provide fix

}

elseif(oap.getResponseCode() ==

PositionDevice.GPS_CHIPSET_MALFUNCTION){

// means GPS chipset malfunction

}

elseif(oap.getResponseCode() == PositionDevice.ALMANAC_OUT_OF_DATE){

// means almanac out of date to get fix

// This scenario occurs when user overrides almanac but device is

// not packet data provisioned

}

else{

// Unknown error occurs

}

}// end of position response error

// position is null

}finally{

if ( c !=null)

c.close();

}

}}

Session:

Project settings saved

Building "motoMidlet"

C:\WTK2.5.1\apps\motoMidlet\src\motoMidlet.java:10: illegal character: \8220

String name = 搈position:delay=low?

^

C:\WTK2.5.1\apps\motoMidlet\src\motoMidlet.java:10: illegal character: \8221

String name = 搈position:delay=low?

^

C:\WTK2.5.1\apps\motoMidlet\src\motoMidlet.java:109: 'finally' without 'try'

} finally {

^

3 errors

com.sun.kvem.ktools.ExecutionException

Build failed

[9382 byte] By [k711a] at [2007-11-27 7:14:37]
# 1
problems come from:// this character: ?/font>and // you cannot write a 'finally' without a catch statementmy solution: http://java.sun.com/developer/onlineTraining/new2java/
suparenoa at 2007-7-12 19:04:52 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

> > // you cannot write a 'finally' without a catch

> statement

>

>

Hope u wanted to say "try" instead of "catch".

Well k711(!!!) ur finally block is actually went inside ur try block. This is nothing but what an improper indentation can do to ones code. :-)

find_suvro@SDNa at 2007-7-12 19:04:52 > top of Java-index,Java Mobility Forums,Java ME Technologies...