Search in sources :

Example 1 with MarkerGson

use of com.peterlaurence.trekadvisor.core.map.gson.MarkerGson in project TrekAdvisor by peterLaurence.

the class MapMarkerImportTask method doInBackground.

@Override
protected Void doInBackground(Void... params) {
    File markerFile = new File(mMap.getDirectory(), MapLoader.MAP_MARKER_FILE_NAME);
    if (!markerFile.exists())
        return null;
    String jsonString;
    try {
        jsonString = FileUtils.getStringFromFile(markerFile);
        MarkerGson markerGson = mGson.fromJson(jsonString, MarkerGson.class);
        mMap.setMarkerGson(markerGson);
    } catch (Exception e) {
        /* Error while decoding the json file */
        Log.e(TAG, e.getMessage(), e);
    }
    return null;
}
Also used : MarkerGson(com.peterlaurence.trekadvisor.core.map.gson.MarkerGson) File(java.io.File)

Aggregations

MarkerGson (com.peterlaurence.trekadvisor.core.map.gson.MarkerGson)1 File (java.io.File)1