Archive

Posts Tagged ‘dtmf’

Using the vibrator, playing a DTMF sound

August 25th, 2009 No comments

(Android phone – how-to/examples)

So you want to make the Android vibe, with one of your actions. For this use android.os.Vibrator

Basically there are 2 lines of code:
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
vibrator.vibrate(milliseconds);

Playing a sound on Android is just as easy:
Use android.media.ToneGenerator

ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_SYSTEM, 100);
tg.startTone(ToneGenerator.TONE_PROP_BEEP2);

Categories: android java Tags: , ,