android - Get URI of 3 mp3 files stored in res/raw folder -


How can I get the URI of 3 MP3 files stored in the / mp3 / res / raw folder, I used: Uri.parse ("Android. Resources: //" + getPackageName () + "/" + R.raw.splash) but do not work, do you have suggestions?

  Public Zero getSongList () {// Query External Audio Controller String Transfer = getContentResolver (); // Uri Music: URI = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; Uri Music URI = Uri Prs ("android.resource: //com.example.musicplayer/raw/" + R.raw.collide); Cursor music cursor = music Resolver.query (music ur, blank, empty, null, zero); // // if valid if composer (composer = null & music console. Mavoostost ()) // // column int title column = composer Int idColumn = musicCursor.getColumnIndex (android.provider.MediaStore.Audio.Media._ID); Int artist artist = column = musician.gate column index (android.provider.MediaStore.Audio.Media.ARTIST); // Adding the song to the list {long this id = music concert.tag (id column); String thisTitle = musicCursor.getString (title column); String this artist = composer .getString (artist column); SongList.add (new song (this id, this title, this artist)); } While (musicCursor.moveToNext ()); }}  

How to obtain URI for this Resources, however, do not have any ContentProvider for them, and therefore your query () will never work. You will need to find some MP3 metadata libraries as input You can take InputStream and you can repeat the metadata you want.

Also keep in mind that many parts of the system value android.resource Uri schemes, because they are not particularly popular.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -