I have developing an android application that needs to play song online. I am using MediaPlayer to play song. But it is working properly in all android version till Lollipop only. In marshmallow, occure problems & app crashes while play song. Is there any permission needed in marshmallow to use MediaPlayer ?
Asked
Active
Viewed 1.2k times
2
-
Please provide the logcat with the actual error message. – Henry Jun 17 '16 at 06:46
-
1You will need READ_EXTERNAL_STORAGE permission and you need to provide it run time. see my answer here : http://stackoverflow.com/a/37269354/6127411 – Janki Gadhiya Jun 17 '16 at 06:57
-
yes marshmallow need runtime permission. play song online you need to give permission of internet at runtime – Divyesh Boda Jun 17 '16 at 06:57
-
You don't need the permission for internet at runtime, but need the permission Read_External_Storage at runtime. – Akhil Soman Jun 17 '16 at 07:10
2 Answers
2
Look at the logcat to see what is the error. Have you add the internet and the storage permission at run time? Check here if you have done it right. https://developer.android.com/training/permissions/requesting.html

Erik Minarini
- 4,795
- 15
- 19
1
It Requires Storage Permission at runtime. Open your App from setting and in Permission see the Require Permissions. On the Permission from there and Run Again. Then give the runtime permission for Marshmallow. Else check the Log for more error.

Avinash Verma
- 2,572
- 1
- 18
- 22