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 clazz = Class.forName(className).asSubclass(MySMSManager.class); sInstance = clazz.newInstance(); } catch (Exception e) { throw new IllegalStateException(e); } } return sInstance; } public abstract ArrayList divideMessage(String text); public abstract void sendMultipartTextMessage(String destinationAddress, String scAddress, ArrayList parts, ArrayList sentIntents, ArrayList deliveryIntents ); }