Reputation: 961
I have an app (NFC Sniffer) which allows users to read NFC tags. When a user attempts to read a tag, 1 of 3 things happens:
Lots of new users are confused about these notification sounds. I want my program to have a help screen, with buttons to play these two sounds.
But how do I locate and play these two notifications from my code?
Upvotes: 2
Views: 2287
Reputation: 40869
You can get these sounds from the sources of the AOSP project and include them in your own app. The sounds are part of the NFC system service app:
https://android.googlesource.com/platform/packages/apps/Nfc/+/master/res/raw/
Btw. starting with Android 4.4, you can disable the sounds while your activity is in the foreground by using the reader mode API with the flag NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS
.
Upvotes: 4