Exemplo n.º 1
0
 private void logForDebugging(Location location, Location correctedLocation) {
   Logger.logToDatabase(
       act,
       db,
       ROUTE_TAG,
       "RouteFragment::onLocationChangeLocation: "
           + "new corrected location: "
           + correctedLocation.toString()
           + " from original: "
           + location.toString());
   Logger.logToDatabase(
       act,
       db,
       ROUTE_TAG,
       "RouteFragment::onLocationChangeLocation: "
           + "threshold: "
           + String.valueOf(getAdvanceRadius()));
   for (Instruction instruction : instructions) {
     Logger.logToDatabase(
         act,
         db,
         ROUTE_TAG,
         "RouteFragment::onLocationChangeLocation: " + "turnPoint: " + instruction.toString());
   }
 }
Exemplo n.º 2
0
  private HttpResponseCache getTileCache() {
    if (act.getExternalCacheDir() == null) {
      return null;
    }

    HttpResponseCache cache = null;
    try {
      File cacheDir = new File(act.getExternalCacheDir().getAbsolutePath() + "/tile-cache");
      int cacheSize = CACHE_SIZE;
      cache = new HttpResponseCache(cacheDir, cacheSize);
      Logger.d("cache hit count: " + String.valueOf(cache.getHitCount()));
      Logger.d("cache info max size: " + String.valueOf(cache.getMaxSize()));
      Logger.d("cache info size: " + String.valueOf(cache.getSize()));
    } catch (IOException e) {
      Logger.e("cant attach a cache");
    }
    return cache;
  }
Exemplo n.º 3
0
 private void showInstruction(int index) {
   if (isPaging) {
     final Instruction instruction = instructions.get(index);
     pagerPositionWhenPaused = index;
     Logger.logToDatabase(act, db, ROUTE_TAG, "paging to instruction: " + instruction.toString());
     pager.setCurrentItem(index);
     debugView.setClosestInstruction(instruction);
   } else {
     pagerPositionWhenPaused = index;
   }
 }
Exemplo n.º 4
0
  private void insertIntoDb(String table, String nullHack, ContentValues contentValues) {
    if (db == null) {
      return;
    }

    try {
      long result = db.insert(table, nullHack, contentValues);
      if (result < 0) {
        Logger.e("error inserting into db");
      }
    } catch (IllegalStateException e) {
      Mint.logException(e);
    }
  }
Exemplo n.º 5
0
 public void setInstructions(ArrayList<Instruction> instructions) {
   Logger.d("instructions: " + instructions);
   this.instructions = instructions;
 }