Ejemplo n.º 1
0
 private void loadSelectedStage() {
   final StageInformation st = selectedStage;
   if (st != null && st.gpxFile != null) {
     if (st.gpx == null) {
       st.gpx = GPXUtilities.loadGPXFile(app, st.gpxFile);
     }
   }
 }
Ejemplo n.º 2
0
  private String saveImport(final GPXUtilities.GPXFile gpxFile, final String fileName) {
    final String warning;

    if (gpxFile.isEmpty()) {
      warning = application.getString(R.string.error_reading_gpx);
    } else {
      final File importDir = application.getAppPath(IndexConstants.GPX_IMPORT_DIR);
      importDir.mkdirs();
      if (importDir.exists() && importDir.isDirectory() && importDir.canWrite()) {
        final GPXUtilities.WptPt pt = gpxFile.findPointToShow();
        final File toWrite = getFileToSave(fileName, importDir, pt);

        warning = GPXUtilities.writeGpxFile(toWrite, gpxFile, application);
        if (warning == null) {
          gpxFile.path = toWrite.getAbsolutePath();
        }
      } else {
        warning = application.getString(R.string.sd_dir_not_accessible);
      }
    }

    return warning;
  }
Ejemplo n.º 3
0
 public String saveFile() {
   return GPXUtilities.writeGpxFile(new File(gpx.path), gpx, app);
 }