コード例 #1
0
  /** Get all data of SMS settings */
  private void getAllData() {

    try {
      ClientDDBB clientDDBB = new ClientDDBB();
      Settings settings = clientDDBB.getSelects().selectSettings();

      if (settings != null) smsText = settings.getSmsText();

      clientDDBB.close();

    } catch (Exception e) {
      Log.e(CLASS_NAME, ExceptionUtils.getString(e));
    }
  }
コード例 #2
0
  /**
   * Check if the receiver phone number have permission to use for send SMS message
   *
   * @return true or false if the phone number (receiver) can or not receive messages
   */
  private boolean checkSendPhoneNumber() {

    try {
      ClientDDBB clientDDBB = new ClientDDBB();
      Phone phone = clientDDBB.getSelects().selectPhoneForPhoneNumber(incomingCallNumber);
      clientDDBB.close();

      if (phone != null) return phone.isUsedToSend();
      else return false;

    } catch (Exception e) {
      Log.e(CLASS_NAME, ExceptionUtils.getString(e));
      return false;
    }
  }