Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.List;

import android.content.Context;

import android.telephony.SmsManager;

public class Main {

    public static void sendSms(Context context, String number, String messageContent) {
        SmsManager smsManager = SmsManager.getDefault();
        List<String> contentList = smsManager.divideMessage(messageContent);
        for (String content : contentList) {
            smsManager.sendTextMessage(number, null, content, null, null);
        }
    }
}