I am getting the time using a time picker and displaying the time in the text view using following code...
private TimePickerDialog.OnTimeSetListener mTimeSe
// Best Result Give Bapu_Darbar:::
Date dt = new Date(); int hours = dt.getHours(); int min = dt.getMinutes(); int am_pm = Calendar.AM_PM;
if(hours>=1 || hours<=3 && am_pm == Calendar.AM){
spl_text.setText("Welcome \n Good Night,Sweet Dream");
}else if(hours>=4 || hours<=12 && am_pm == Calendar.AM){
spl_text.setText("Welcome \n Good Morning,Have A Nice Day");
}else if(hours>=13 || hours<=17 && am_pm == Calendar.PM){
spl_text.setText("Welcome \n Good Afternoon");
}else if(hours>=18 || hours<=20 && am_pm == Calendar.PM){
spl_text.setText("Welcome \n Good Evening");
}else if(hours>=21 || hours<=24 && am_pm == Calendar.PM){
spl_text.setText("Welcome \n Good Night,Sweet Dream");
}