Exemplo n.º 1
0
  // run the query and add the elements to cluster
  private void setUpquery(String qu) {

    try {
      // get database
      database = dbHelper.getDataBase();
      dbCursor = database.rawQuery(qu, SideBar.MenuFilter);
      dbCursor.moveToFirst();

      // get items for each cluster on map from db
      while (!dbCursor.isAfterLast()) {
        MyItem m =
            new MyItem(
                Double.valueOf(this.dbCursor.getString(3)),
                Double.valueOf(this.dbCursor.getString(4)),
                (this.dbCursor.getString(1)),
                (this.dbCursor.getString(2)),
                this.dbCursor.getString(5),
                this.dbCursor.getString(6),
                this.dbCursor.getString(7),
                this.dbCursor.getString(8),
                this.dbCursor.getString(9));

        // add items to database
        mClusterManager.addItem(m);

        dbCursor.moveToNext();
      }

    } finally {
      // close database
      if (database != null) {
        dbHelper.close();
      }
    }
  }
Exemplo n.º 2
0
  // start creating the database
  private void setUpDatabase() {
    try {
      markerFilter();
      dbHelper.createDataBase();

    } catch (IOException ioe) {
      Log.e("heloH", "heloH");
    }
  }