Back to project page android-weather-station.
The source code is released under:
Apache License
If you think the Android project android-weather-station listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.grundid.weather; // w ww . j a v a 2 s . c om import android.content.Context; import android.media.MediaPlayer; public class Beeper implements Runnable { private Context context; public Beeper(Context context) { this.context = context; } @Override public void run() { MediaPlayer player = null; int countBeep = 0; while (countBeep < 2) { player = MediaPlayer.create(context, R.raw.beep); player.start(); countBeep += 1; try { // 100 milisecond is duration gap between two beep Thread.sleep(player.getDuration() + 100); player.release(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }