Skip to content Skip to sidebar Skip to footer

What Is Difference Between _id And Audio_id Column?

I've googled it, searched on the official android docs, and found nothing satisfying. I'm developing music player app that has access to Media Storage and confused between _ID and

Solution 1:

AUDIO_ID is the unique identifier of the audio file.

_ID is the identifier of the combination of playlist_id and audio_id. In this case it's possible to have the same audio in one playlist multiple times. That's why each audiofile to playlist row has an unique identifier _ID.

It's basically a link table for playlists and audio, and each link has it's own _ID

Like this:

 ID    AUDIO_ID    PLAYLIST_ID
----- ----------  -------------111211           <----We can have the same combination, so we need an unique identifier.351482

Source: MediaStore.Audio.Playlists.Members Documentation

Solution 2:

Following is difference.

_ID

The unique ID for a row.

AUDIO_ID

The ID of the audio file

Difference

_ID is column name of BASECOLUMNS database table. It is implemented in following other tables.

Browser.BookmarkColumns, Browser.SearchColumns, CalendarContract.Attendees, CalendarContract.CalendarAlerts, CalendarContract.CalendarEntity, CalendarContract.Calendars, CalendarContract.Colors, CalendarContract.ColorsColumns, CalendarContract.Events, CalendarContract.EventsEntity

And AUDIO_ID is part of MediaStore.Audio.AudioColumns, which has implementation of BASECOLUMNS table.

MediaStore.Audio.AudioColumns : Columns for audio file that show up in multiple tables.

Reference : _ID , AUDIO_ID

Post a Comment for "What Is Difference Between _id And Audio_id Column?"