Android Open Source - SNISI-droid S M S Sent Receiver






From Project

Back to project page SNISI-droid.

License

The source code is released under:

Apache License

If you think the Android project SNISI-droid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.yeleman.snisidroid;
//from  w ww  . ja  v a 2  s  .c  om
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.SmsManager;
import android.util.Log;
import android.widget.Toast;

public class SMSSentReceiver extends BroadcastReceiver {

    private static final String TAG = Constants.getLogTag("SMSSentReceiver");
    private SMSUpdater mSmsUpdater;

    public SMSSentReceiver(SMSUpdater u)
    {
        super();
        mSmsUpdater = u;
        Log.d(TAG, "SMSSentReceiver instanciated");
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAG, "onReceive SMS_SENT");
        int feedback_status = Constants.SMS_UNKNOWN;
        String feedback_message = "";
        switch (getResultCode()) {
            case Activity.RESULT_OK:
                feedback_status = Constants.SMS_SUCCESS;
                feedback_message = "SMS envoy.";
                break;
            case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
                feedback_status = Constants.SMS_ERROR;
                feedback_message = "Generic Failure";
                break;
            case SmsManager.RESULT_ERROR_NO_SERVICE:
                feedback_status = Constants.SMS_ERROR;
                feedback_message = "Pas de rseau (No Service)";
                break;
            case SmsManager.RESULT_ERROR_NULL_PDU:
                feedback_status = Constants.SMS_ERROR;
                feedback_message = "Null PDU";
                break;
            case SmsManager.RESULT_ERROR_RADIO_OFF:
                feedback_status = Constants.SMS_ERROR;
                feedback_message = "Carte SIM dsactive.";
                break;
            default:
                break;
        }
        if (feedback_status == Constants.SMS_SUCCESS) {
            Toast.makeText(context, feedback_message, Toast.LENGTH_SHORT).show();
        }
        Log.d(TAG, feedback_message);

        mSmsUpdater.gotSMSStatusUpdate(feedback_status, feedback_message);
    }

}




Java Source Code List

com.yeleman.nutrition.NutritionHome.java
com.yeleman.nutrition.NutritionInputsReportData.java
com.yeleman.nutrition.NutritionInputsReport.java
com.yeleman.nutrition.NutritionMonthlyHome.java
com.yeleman.nutrition.NutritionMonthlyReportData.java
com.yeleman.nutrition.NutritionSummaryReport.java
com.yeleman.nutrition.NutritionURENAMExsamReport.java
com.yeleman.nutrition.NutritionURENAMO59Report.java
com.yeleman.nutrition.NutritionURENAMPWReport.java
com.yeleman.nutrition.NutritionURENAMReportData.java
com.yeleman.nutrition.NutritionURENAMReport.java
com.yeleman.nutrition.NutritionURENAMU23O6Report.java
com.yeleman.nutrition.NutritionURENAMU59O23Report.java
com.yeleman.nutrition.NutritionURENASO59Report.java
com.yeleman.nutrition.NutritionURENASReportData.java
com.yeleman.nutrition.NutritionURENASReport.java
com.yeleman.nutrition.NutritionURENASU59O6Report.java
com.yeleman.nutrition.NutritionURENFormIface.java
com.yeleman.nutrition.NutritionURENForm.java
com.yeleman.nutrition.NutritionURENIO59Report.java
com.yeleman.nutrition.NutritionURENIReportData.java
com.yeleman.nutrition.NutritionURENIReport.java
com.yeleman.nutrition.NutritionURENIU59O6Report.java
com.yeleman.nutrition.NutritionURENIU6Report.java
com.yeleman.nutrition.NutritionWeeklyReportData.java
com.yeleman.nutrition.NutritionWeeklyReport.java
com.yeleman.projetsnisi.ApplicationTest.java
com.yeleman.smir.Constants.java
com.yeleman.smir.CustomOnItemSelectedListener.java
com.yeleman.smir.SMIRAlert.java
com.yeleman.smir.SMIRHome.java
com.yeleman.smir.SharedChecks.java
com.yeleman.snisidroid.ChangePassword.java
com.yeleman.snisidroid.CheckedFormActivity.java
com.yeleman.snisidroid.Constants.java
com.yeleman.snisidroid.Popups.java
com.yeleman.snisidroid.Preferences.java
com.yeleman.snisidroid.ReportData.java
com.yeleman.snisidroid.SMSDeliveredReceiver.java
com.yeleman.snisidroid.SMSReceiver.java
com.yeleman.snisidroid.SMSSentReceiver.java
com.yeleman.snisidroid.SMSUpdater.java
com.yeleman.snisidroid.SNISIAbout.java
com.yeleman.snisidroid.SNISIApp.java
com.yeleman.snisidroid.SNISIHome.java
com.yeleman.snisidroid.SharedChecks.java