You have to set the alarmanager for the time in the timepicker.If the time matches with current time it will trigger the alarm and play the mediaplayer .something like this
AlarmManager alarmanager=(AlarmManager) getSystemService(Context.ALARM_SERVICE);
TimePicker ti = (TimePicker) findViewById(R.id.time_alarm);
ti.setOnTimeChangedListener(new OnTimeChangedListener() {
public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
// TODO Auto-generated method stub
selectedhour = hourOfDay;
selectedminute = minute;
count = 2;
}
});
now convert the selectedhour and selectedminute into millisecond and set it to alarmanager
alarmanager.set(AlarmManager.RTC_WAKEUP, time in millisec,pndingIntent) ;