Exemplo n.º 1
0
 private void showQiblahAngle() {
   String sMessage;
   if (m_bServiceBound) {
     try {
       QiblahAngle qa = m_AthanService.getQiblahAngle();
       if (null == qa)
         sMessage = "Angle can not be calculated as location could not be determined";
       else sMessage = qa.toString();
     } catch (RemoteException re) {
       sMessage = "Could not retrieve qiblah angle";
     }
   } else sMessage = "Could not retrieve qiblah angle";
   showAlertDialog("Qiblah Angle", sMessage);
 }
Exemplo n.º 2
0
 private PrayerTimes getPrayerTimesOnDate() {
   if (m_bServiceBound) {
     try {
       PrayerTimes pt = m_AthanService.getPrayerTimesOfDate(m_Day, m_Month, m_Year);
       if (null == pt)
         showAlertDialog(
             "Preyer times",
             "Prayer times could not be calculated as location information is unavailable");
       return pt;
     } catch (RemoteException re) {
       showAlertDialog("Preyer times", re.getMessage());
       Log.e(
           CONSTANTS.LOG_TAG, "Could not get prayer times from athan service: " + re.getMessage());
     }
   } else showAlertDialog("Preyer times", "Service is not bound");
   return null;
 }
Exemplo n.º 3
0
 private void showNextPrayerTime() {
   String sMessage;
   if (m_bServiceBound) {
     try {
       PrayerTime pt = m_AthanService.getNextPrayerTime();
       if (null == pt) sMessage = "No more prayer today";
       else
         sMessage =
             pt.getPrayerName()
                 + " "
                 + pt.getPrayerTime().get(Calendar.HOUR_OF_DAY)
                 + ':'
                 + pt.getPrayerTime().get(Calendar.MINUTE);
     } catch (RemoteException re) {
       sMessage = "Could not retrieve prayer time";
     }
   } else sMessage = "Could not retrieve prayer time";
   showAlertDialog("Next prayer time", sMessage);
 }