Code example for SQLiteStatement

Methods: bindObjectToProgram, simpleQueryForString

0
  public String getDataMimeType(long dataId) {
      // Make sure compiled statements are ready by opening database 
      getReadableDatabase();
      try { 
          // Try database query to find mimetype 
          DatabaseUtils.bindObjectToProgram(mDataMimetypeQuery, 1, dataId);
          String mimetype = mDataMimetypeQuery.simpleQueryForString();
          return mimetype;
      } catch (SQLiteDoneException e) {
          // No valid mapping found, so return null 
          return null; 
      } 
  } 
   
  public String getDataView() {
  	return Views.DATA_ALL;
  } 
   
  public String getPlaceView() {
    return Views.PLACES_ALL;
  }