I am attaching the sound files in the assets folder for play sound in the notification but I am not able to play sound from the assets folder.
I have setting page from w
ContentProvider is the way to go. I don't think there is a need to copy files to the data directory like @Dharmendra suggests. You can access the asset folder directly though the ContentProvider
public AssetFileDescriptor openAssetFile(Uri uri, String mode)
throws FileNotFoundException {
String filePart = Sound.getSoundFileName(uri);
try {
return getContext().getResources().getAssets().openFd(filePart + ".ogg");
}catch(IOException e) {
Log.d(TAG, "fail " + e.getMessage());
}
return null;
}