transplanting from AndroidBuildingMusicPlayer