Hi,

I'm a final year student at a Scottish university and I was hoping someone on here would help me in tweaking my capture MIDlet into writing .gpx XML files which I can then use to advance my project?

Also, does anyone know how or if can set it to only use the internal gps module?

At the moment my capture code looks like this:

public void run()
{
String string;
String out;
String l1;
String l2;
try {
location = locationProvider.getLocation(60);
coordinates = location.getQualifiedCoordinates();
if (coordinates != null) {
double lat = coordinates.getLatitude();
double lon = coordinates.getLongitude();
if(lat < 0.0 )
{
l1="S";
lat = lat*(-1);
}else {
l1 = "N";
}
if(lon < 0.0 )
{
l2="W";
lon = lon*(-1);
}else {
l2 = "E";
}
String latf = Coordinates.convert(lat,1);
String lonf = Coordinates.convert(lon,1);
string = "\nLatitude :\n" + latf + l1 + "\n\nLongitude :\n" + lonf + l2;
out = "lat " + latf + l1 + " lon " + lonf + l2 + "\n";

} else {
string = "Location API failed";
out = "error \n";
}
write2(out);
GPSscheduledupdater.text.setText(string);
} catch (Exception e) {
//TODO: Handle exception.
out = "timed out\n";
write2(out);
GPSscheduledupdater.text.setText("Timed out, unable to find satellite.");
}

private void write2(String a)
{
try {
byte data[] = a.getBytes();
ops.write(data);
} catch (IOException e) {
// TODO Auto-generated catch block
GPSscheduledupdater.text.setText("Error in writing");
}

}

I know, its messy, sorry.

On a side note, does anyone here know how I could get in touch with the developers of the S60 emulator? I need to find out if I can write a Java application that can feed these .gpx files through in a way similar to the location tool in the emulator already?

Again, thank you so much for any help you can provide.