Darko Petkovski Darko Petkovski - 4 months ago 5x
Android Question

Android notifications play sound from assets folder

I'm trying to play notifications sound from the assets folder, but when notification triggers the notification is shown but no sound is played and there is no error or warning in the logCat. I'm using this code for creating notifications:

builder = new NotificationCompat.Builder(context)
// Set Icon
// Set Ticker Message
// Set Title
// Set Text
// Add an Action Button below Notification
context.getString(R.string.share), pendingShare)
// Set PendingIntent into Notification
// Dismiss Notification
+ prefs.getString(Constants.NOTIF_SOUND,

can someone help me solve this issue?


Put your mp3 file under raw folder. If you put it under asset/ it's going to be compressed twice and you can't use it.