I am developing a music application in Android, and when retrieving the album, artist, genre names of the songs, I get some unknown names.
For albums, the unknown album name is displayed as “music”.
For artists, the unknown artist name is displayed as “”
and for Genres, the unknown genre is displayed as ” “
Are these default names same on all the devices?? Because I want to rename those unknown names to more readable- Ex:”Unknown Artist” or “Unknown Album”
I had tried in only 2 devices and found that unknown album name is displayed as “music” BUT unknown artist name is displayed differently in both devices.
I would like to know how to handle these Unknown Names.
Seems You need UNKNOWN_STRING:
I’ve checked MediaPlayer android code here and, actually by default it’s doing the following steps:
So, You need just to check data returned by ContentProvider for
MediaStore.UNKNOWN_STRINGand handle it whatever You like to. (e.g. provide the same string on all devices).For example, checkout com.android.music.MediaPlaybackActivity source, it has the following code: