MultiSmsSender/src/com/openwide/android/MySMSManager.java

35 lines
1.2 KiB
Java
Raw Normal View History

package com.openwide.android;
import java.util.ArrayList;
import android.app.PendingIntent;
import android.os.Build;
public abstract class MySMSManager {
private static MySMSManager sInstance;
public static MySMSManager getInstance() {
if(sInstance == null) {
String className;
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
if (sdkVersion < Build.VERSION_CODES.DONUT) {
className = "com.openwide.android.MySMSManagerCupcake";
} else {
className = "com.openwide.android.MySMSManagerOther";
}
try {
Class<? extends MySMSManager> clazz =
Class.forName(className).asSubclass(MySMSManager.class);
sInstance = clazz.newInstance();
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
return sInstance;
}
public abstract ArrayList<String> divideMessage(String text);
public abstract void sendMultipartTextMessage(String destinationAddress, String scAddress, ArrayList<String> parts, ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents );
}