public void addSongId(final Long songId,final String songName,final String albumName,final String artistName){
  if (songId == null || songName == null || albumName == null || artistName == null) {
    return;
  }
  final Long playCount=getPlayCount(songId);
  final SQLiteDatabase database=getWritableDatabase();
  final ContentValues values=new ContentValues(5);
  database.beginTransaction();
  values.put(FavoriteColumns.ID,songId);
  values.put(FavoriteColumns.SONGNAME,songName);
  values.put(FavoriteColumns.ALBUMNAME,albumName);
  values.put(FavoriteColumns.ARTISTNAME,artistName);
  values.put(FavoriteColumns.PLAYCOUNT,playCount != 0 ? playCount + 1 : 1);
  database.delete(FavoriteColumns.NAME,FavoriteColumns.ID + " = ?",new String[]{String.valueOf(songId)});
  database.insert(FavoriteColumns.NAME,null,values);
  database.setTransactionSuccessful();
  database.endTransaction();
}

public void addSongId ( final Long songId , final String songName , final String albumName , final String artistName ) { if ( songId == null || songName == null || albumName == null || artistName == null ) { return ; } final Long playCount = getPlayCount ( songId ) ; final SQLiteDatabase database = getWritableDatabase ( ) ; final ContentValues values = new ContentValues ( 5 ) ; database . beginTransaction ( ) ; values . put ( FavoriteColumns . ID , songId ) ; values . put ( FavoriteColumns . SONGNAME , songName ) ; values . put ( FavoriteColumns . ALBUMNAME , albumName ) ; values . put ( FavoriteColumns . ARTISTNAME , artistName ) ; values . put ( FavoriteColumns . PLAYCOUNT , playCount != 0 ? playCount + 1 : 1 ) ; database . delete ( FavoriteColumns . NAME , FavoriteColumns . ID + " = ?" , new String [ ] { String . valueOf ( songId ) } ) ; database . insert ( FavoriteColumns . NAME , null , values ) ; database . setTransactionSuccessful ( ) ; database . endTransaction ( ) ; }
used to store song ids in our database
