i have a folder of mp3 files that i need to schedule a notification from , so i put them in
assests/sounds/1----10.mp3
i can easily access them with
private fun listAssetFiles(path: String): ArrayList<String> {
try {
var list = getAssets().list(path)!!
var res = ArrayList<String>()
for( item in list ) {
res.add("$path/$item")
}
return res
} catch (e: IOException) {
return arrayListOf()
}
}
for playing with MediaPlayer
inside a listView , but all previous answers needs them inside res folder
Notification noti = new Notification.Builder(this)
setSound(Uri.parse("android.resource://" + v.getContext().getPackageName() + "/" +
R.raw.yourmp3file))
so how can i set path from assets or its not possible