0
track.append("<trkseg>");
        } 
 
        track.append("<trkpt lat=\"")
                .append(String.valueOf(loc.getLatitude()))
                .append("\" lon=\"")
                .append(String.valueOf(loc.getLongitude()))
                .append("\">");
 
        if (loc.hasAltitude())
        { 
            track.append("<ele>").append(String.valueOf(loc.getAltitude())).append("</ele>");
        } 
 
        if (loc.hasBearing())
        { 
            track.append("<course>").append(String.valueOf(loc.getBearing())).append("</course>");
        } 
 
        if (loc.hasSpeed())
        { 
            track.append("<speed>").append(String.valueOf(loc.getSpeed())).append("</speed>");
        } 
 
        if (loc.hasAccuracy() && loc.getAccuracy() > 0)
        { 
            // Accuracy divided by 5 or 6 for approximate HDOP 
            track.append("<hdop>").append(String.valueOf(loc.getAccuracy() / 5)).append("</hdop>");
        } 
 
        track.append("<src>").append(loc.getProvider()).append("</src>");
 
        if (satelliteCount > 0)
        { 
            track.append("<sat>").append(String.valueOf(satelliteCount)).append("</sat>");
        }