How can I make an android application do stuff according to time? -
can me this? i'm unable find simple way of doing it.
basically want @ start (eg: hey, morning mr.xyz). ideas?
thanks in advance.
solution:
int = calendar.getinstance().get(calendar.hour_of_day); if (a >= 4 && < 12) { messages.add(new message("good morning!",false)); = "good morning!";}
you can whats hour of day right doing this:
calendar.get(calendar.hour_of_day) and using condition checking conclude application has morning , evening or afternoon
and can make app whatever have concluded using tts instance this:
tts = new texttospeech(this, this); tts.speak("good morning/evening/agternoon", texttospeech.queue_flush, null); also class have implement texttospeech.oninitlistener
and wish app should greet user @ start should write in oncreate() of first activity
Comments
Post a Comment