Code example for Location

Methods: getAltitudegetBearinggetLatitudegetLongitudegetProvidergetSpeedhasAltitudehasBearinghasSpeed

0
    { 
 
        StringBuilder waypoint = new StringBuilder();
 
        waypoint.append("\n<wpt lat=\"")
                .append(String.valueOf(loc.getLatitude()))
                .append("\" lon=\"")
                .append(String.valueOf(loc.getLongitude()))
                .append("\">");
 
        if (loc.hasAltitude())
        { 
            waypoint.append("<ele>").append(String.valueOf(loc.getAltitude())).append("</ele>");
        } 
 
        if (loc.hasBearing())
        { 
            waypoint.append("<course>").append(String.valueOf(loc.getBearing())).append("</course>");
        } 
 
        if (loc.hasSpeed())
        { 
            waypoint.append("<speed>").append(String.valueOf(loc.getSpeed())).append("</speed>");
        } 
 
        waypoint.append("<name>").append(description).append("</name>");
 
        waypoint.append("<src>").append(loc.getProvider()).append("</src>");
 
 
        waypoint.append("<time>").append(dateTimeString).append("</time>");
 
        waypoint.append("</wpt>\n");