android-music-player

java.lang.UnsupportedOperationException Albums cannot be directly modified

|▌冷眼眸甩不掉的悲伤 提交于 2020-08-09 19:52:31
问题 How to update album metadata of audio file in Android Q media store? I tried the answer suggested, https://stackoverflow.com/a/60152702/4732846, it worked. But this works for individual tracks. If I use the same logic and form the uri for albums, val uri = ContentUris.withAppendedId(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI, albumId) and try to edit. I get this exception. java.lang.UnsupportedOperationException Albums cannot be directly modified This is the closest link that I could find

How to update metadata of audio file in Android Q media store?

情到浓时终转凉″ 提交于 2020-05-21 21:38:13
问题 Updating metadata of audio file in media store is not working in Android Q OS, it works in all other OS. I am using content provider with uri specified as MediaStore.Audio.Media.EXTERNAL_CONTENT_URI. It is working fine in all below Android Q device. Below is the code that I am using to update track metadata. ContentValues cv = new ContentValues(); ContentResolver resolver = getContentResolver(); Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; cv.put(MediaStore.Audio.Media.TITLE,

How to update metadata of audio file in Android Q media store?

白昼怎懂夜的黑 提交于 2020-05-21 21:35:28
问题 Updating metadata of audio file in media store is not working in Android Q OS, it works in all other OS. I am using content provider with uri specified as MediaStore.Audio.Media.EXTERNAL_CONTENT_URI. It is working fine in all below Android Q device. Below is the code that I am using to update track metadata. ContentValues cv = new ContentValues(); ContentResolver resolver = getContentResolver(); Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; cv.put(MediaStore.Audio.Media.TITLE,

How to implement Exoplayer 2.11.1 in android?

六眼飞鱼酱① 提交于 2020-04-11 02:16:08
问题 i am trying to implement exoplayer this is my exoplayer version implementation 'com.google.android.exoplayer:exoplayer:2.11.1' i am creating a music player app and i don't know anything about exoplayer i am trying to implement exoplayer from last 2 days but it's not working. i couldn't understand anything in the official documentation . i find many example and tutorial but it's all about playing video using exoplayer . many example's are using deprecated methods. I am trying to implement

How to get read external storage permissions?

一个人想着一个人 提交于 2020-03-13 07:56:00
问题 I'm developing an mp3 player application for android and I'm getting an error related to user permissions(READ_EXTERNAL_STORAGE) This is my code where I ask for permissions: int permissionCheck = ContextCompat.checkSelfPermission(PlayListActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE); if (ContextCompat.checkSelfPermission(PlayListActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { // OPCIONAL(explicaciones de poque pedimos los permisos)

How to create a new Playlist using ContentResolver

孤街浪徒 提交于 2020-02-26 17:32:12
问题 I'm attempting to create a new Playlist , using Android's ContentResolver , that will be added to music player's playlists, but when the code runs, the insert into the playlist returns null (for the Uri ) and when I check the music player's playlists, my new Playlist entry isn't there. I suspect that the reason that the insert() returns null is because I haven't created the Playlist correctly. Could someone clarify how to dynamically create a new playlist, given that my code doesn't work. (In

How to I achieve ViewPager (next/previous) in Music player App

时光总嘲笑我的痴心妄想 提交于 2020-02-20 04:53:43
问题 I want to know how I can achieve next and previous using swipe via a view pager. The final result I want is the one that Google Play Music has. I have uploaded a picture of what my app is behaving like and also what I expect. I basically cannot get my ViewPager to show me previews of the next and previous tracks. Can anyone please help me with how I can populate the view pager with pages of the tracks I want to play hence achieving that Google play music next/previous swipe in their music

which way is the best for playing 5 songs in android app?

浪子不回头ぞ 提交于 2020-01-25 06:48:08
问题 I have 5 songs that must be played in my app, I locate them in raw resource folder. how can I play them? please give me the best way. I use default player or use mediaplayer.start() ? I use 5 buttons to show them and play them. public class MusicActivity extends AppCompatActivity implements View.OnClickListener{ private MediaPlayer a,b,c,d,e; private Button aBTN,bBTN,cBTN, dBTN ,fBTN; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);