Is there a way to play built-in sound effects programmatically? I want to play the NFC sound effect when my app scans an NFC tag (success sound effect and failure sound effect).
Asked
Active
Viewed 1,812 times
1 Answers
2
Im just pasting code from the accepted answer that is in - StackOverflow question to play Android Notification sound
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();
} catch (Exception e) {
e.printStackTrace();
}

Community
- 1
- 1

karthik prasad
- 738
- 7
- 15
-
1How would I play the NFC sound effect? – Mark Buikema Nov 24 '16 at 12:32