User Tools

Site Tools


install

This is an old revision of the document!


Installing Super Duper SMS Manager

1. Download the SDK

2. In a strings file in /res, add your SDSMS_ID:

<string name=“SDSMS_ID”>UNREGISTERED_APP</string>

If you have a registration ID, enter it here. Otherwise, this can be anything you want it to be (or leave it alone). Setting it to a unique value is recommended.

3. Determine the appropriate interface type for your app based on these values:

  • ACCESS_TYPE_SYSTEM - please contact us for system level access as a carrier or manufacturer
  • ACCESS_TYPE_SYSRESERVED - please contact us for reserved, premium access and features
  • ACCESS_TYPE_ANTISPAM - Antispam apps can block messages from regular messaging and other apps

Antispam apps should not request “SMS_DELIVERED” - if you do, you will be denied this permission level and it will default to “unregistered” and your app will not work. This will also help with backward compatibility. Also, SDSMS will send duplicate messages to your app to confirm if the broadcast should be aborted based your user settings. You will not have SMS/MMS write access to the SMS provider.

  • ACCESS_TYPE_PLUGIN - SMS / MMS preprocessing for special features

Plugin apps should not request “SMS_DELIVERED” - if you do, you will be denied this permission level and it will default to “unregistered” and your app will not work. This will also help with backward compatibility. Also, SDSMS will send duplicate messages to your app to confirm if the broadcast should be aborted or modified by your app. You will not have SMS/MMS write access to the SMS provider, so modifications must be made to the broadcast intent.

  • ACCESS_TYPE_AUTORESPONDER - SMS Autoresponders

Autoresponder apps should not request “SMS_DELIVERED” - if you do, you will be denied this permission level and it will default to “unregistered” and your app will not work. This will also help with backward compatibility. Do not write the received message to the SMS provider.

  • ACCESS_TYPE_MSGRESERVED - Premium access for messaging apps

Provide enhanced processing and services before standard messaging apps. Please contact us for details.

  • ACCESS_TYPE_MESSAGING - Standard text messaging apps.

By requesting this type of access your app will be responsible for writing to the SMS database. Therefore, all features should work in your app. As with pre-KitKat messaging, your app should abort the broadcast if there is reason to (for example, you have an anti-spam feature). The first “messaging” app to either abort or write the message will be the last in this group to receive it.

It is important to follow Android's recommendation to disable all features when you are not the “default sms app”. However, SDSMS allows you to do the same “checks” to determine if you are the SDSMS “default sms app.”

  • ACCESS_TYPE_BACKUP - Backup apps will have full access to the SMS database. Since the system broadcasts “SMS_RECEIVED”, SDSMS will do the same (in the event that Android changes that going forward). If you integrate with SDSMS, you will be able to provide full backup/recovery without user intervention or action.
  • ACCESS_TYPE_OBSERVER - Observers will simply receive an additional SMS_RECEIVED broadcast
  • ACCESS_TYPE_UNREGISTERED - reserved for apps that integrate and do not request an appropriate Access Type (either based on their requested permissions, behavior, SDSMS review, attempting to modify the SMS tables with authorization, etc.)

4. Replace SmsManager wtih SDSmsManager anywhere you use it in your project. If you set it globally in an Application class, that will work too. For example replace:

SDSmsManager mSDSmsManager = SDSmsManager.getDefault(context, context.getString(R.string.SDSMS_ID), SDSmsManager.ACCESS_TYPE_MESSAGING);

5. Replace all SmsManager calls with mSDSmsManager, like this:

SDSmsManager sms = SDSmsManager.getDefault(context, context.getString(R.string.SDSMS_ID),
      		SDSmsManager.ACCESS_TYPE_MESSAGING);
try {
	sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);
} catch (Exception e) {
	// error sending message, notify user and update database
    		sendError(msgId, phoneNumber);
}

6. If you use a SqliteWrapper like many examples provide, simply replace you import statement in those classes with the following:

import com.sirisdevelopment.superdupersmsmanager.database.sqlite.SqliteWrapper;

The included class does URI resolution normally, but included in the SDK is the SDContentResolver class. This class simply checks to see if you URI should be converted to SDSMS Uri's prior to being resolved. Also, this class will make the appropriate calls to SDSMS to acknowledge your proper integration.

7. In some cases, you may reference Uri's from Telephony or even statically. All MmsSms Uri's need to be determined via methods that are provided. For example to get the Sms.Inbox Uri replace the following:

Sms.Inbox.CONTENT_URI

with this code (and import SDSmsManager into any classes that do not already have it):

SDSmsManager.Sms.Inbox.CONTENT_URI()

As a side note, if you create or make static references to these Uri's, this will not work because the methods will only execute as the app is instantiated. If the user changes the default SMS app, then your app may not behave properly. These must be runtime references. These are static methods, so your compiler will not complain but it will most likely result in problems.

install.1392587544.txt.gz · Last modified: 2014/02/16 21:52 by superdupersms