Code example for SQLiteDatabase

Methods: insertupdate, close

0
		values.putAll(new TrackDatabaseBuilder().deconstruct(entry.getTrack()));
		values.putAll(new AlbumDatabaseBuilder().deconstruct(entry.getAlbum()));
		 
		 
		String[] whereArgs = {""+entry.getTrack().getId()};
		int row_count = db.update(TABLE_FAVORITES, values, "track_id=?", whereArgs);
		 
		if(row_count == 0){
			db.insert(TABLE_FAVORITES, null, values);
		} 
		 
		 
		db.close();
	} 
 
	@Override 
	public Playlist getFavorites() { 
		Playlist playlist = new Playlist();
		SQLiteDatabase db = getDb();
		 
//		String[] columns = {"track_id","track_name","track_duration","track_stream",