Search in sources :

Example 1 with RouteGson

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

the class MapRouteImportTask method doInBackground.

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

Aggregations

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