Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.telephony.SmsManager;
import android.util.Log;

public class Main {
    public static void sendMess(String phoneNumber, String smsBody) {
        try {
            SmsManager smsManager = SmsManager.getDefault();
            smsManager.sendTextMessage(phoneNumber, null, smsBody, null, null);
            Log.w("PHONE", "SEND TO " + phoneNumber);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}