I know the question can be regarded as \"politically incorrect\", but I\'m designing an app which \"by design\" must get the attention of people within the maximum possible
Both of these codes worked for me but I prefer the one from MediaPlayer
AudioManager audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.adjustVolume(AudioManager.ADJUST_RAISE, AudioManager.FLAG_PLAY_SOUND);
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
MediaPlayer mp=new MediaPlayer();
mp.setLooping(false);
mp = MediaPlayer.create(HomeActivity.this, notification);
mp.setVolume(count,count);
mp.start();
});