What I need is a hint, it helps to know how to implement an AlarmManager that whenever something comes up it will appear something like this
OntheHomescreenofthephoneandmakeasoundevery5seconds
ForthenotificationIhavethefollowingcode
protectedvoidcriarNotificacao(Contextcontext,MensagemAlertamessagesAlerts,Class<?>activity){NotificationManagernotificationManager=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);Notificationnotificaction=newNotification(R.drawable.ic_launcher,messagesAlerts.getTitle(),System.currentTimeMillis());notificaction.sound=Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,"6");
notificaction.flags |= Notification.FLAG_INSISTENT;
notificaction.flags |= Notification.FLAG_AUTO_CANCEL;
PendingIntent p = PendingIntent.getActivity(this, 0,
new Intent(this.getApplicationContext(), MyActivity.class), 0);
notificaction.setLatestEventInfo(this, messagesAlerts.getSubTitle(),
messagesAlerts.getBody(), p);
notificaction.vibrate = new long[] { 100, 1000, 1000, 1000 };
notificationManager.notify(R.string.app_name, notificaction);
}
The other class
public class MensagemAlerta {
private CharSequence title;
private CharSequence body;
private CharSequence subTitle;
public MensagemAlerta(CharSequence title, CharSequence body,
CharSequence subTitle) {
this.title = title;
this.body = body;
this.subTitle = subTitle;
}
public CharSequence getTitle() {
return title;
}
public void setTitle(CharSequence title) {
this.title = title;
}
public CharSequence getBody() {
return body;
}
public void setBody(CharSequence body) {
this.body = body;
}
public CharSequence getSubTitle() {
return subTitle;
}
public void setSubTitle(CharSequence subTitle) {
this.subTitle = subTitle;
}}
NOTE: I call this function from within a Thread