I am getting the time using a time picker and displaying the time in the text view using following code...
private TimePickerDialog.OnTimeSetListener mTimeSe
int am_pm=mycalendar.get(Calendar.AM_PM);
String amOrpm=((am_pm==Calendar.AM)?"am":"pm");
But as per my opinion simpleDateFormat would be the best use, like this:
final Calendar c = Calendar.getInstance(TimeZone.getTimeZone("America/Chicago"));
SimpleDateFormat format = new SimpleDateFormat("h:mm a");
format.setTimeZone(c.getTimeZone());
String myFormatted time = format.format(c.getTime());
It's better as the calendar by default will return 00 for 12 pm, which you might don't want.