User Tools

Site Tools


install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
install [2014/03/26 18:55]
superdupersms
install [2014/03/27 14:31]
superdupersms
Line 53: Line 53:
 </​code>​ </​code>​
  
-Then that source code can be rewritten as this, and the "sms" authority will resolve to "​sdsms" ​when necessary:​ +Then that source code can be rewritten as follows ​and the "sdsms" authority will use the Super Duper Messaging Manager provider ​when it is the "Default SMS App" ​and it will use the standard ​"​sms"​ authority when it is not:
-<code java>​SDContentResolver sdContentResolver = new SDContentResolver(context);​ +
- +
-final String[] projection = new String[] { "retr_st", "​date",​ "​_id",​ "​ct_t"​ }; +
-Uri uri = Uri.parse("content://​mms-sms/​conversations"​);​ +
- +
-Cursor cursor = sdContentResolver.query(uri,​ projection, null, null,"​_id DESC"​);​ +
-</​code>​ +
- +
-Conversely, using "sdsms" authority ​will resolve to "​sms" ​when necessary (this code is equivalent to the above example):+
  
 <code java>​SDContentResolver sdContentResolver = new SDContentResolver(context);​ <code java>​SDContentResolver sdContentResolver = new SDContentResolver(context);​
Line 72: Line 63:
 </​code>​ </​code>​
  
-This is a convenience method only. We do not require that you use SDContentResolver.+This is a convenience method only. We do not require that you use SDContentResolver ​unless you are currently using the Android ContentResolver for querying SMS content.
  
-Also, this class will make the appropriate calls to SDMM to acknowledge ​your proper integration.+Also, this class will make the appropriate ​registration ​calls to SDMM to ensure SDMM identifies and handles ​your app appropriately.
  
-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:+7. In some cases, you may reference Uri's from Telephony or even statically. All MmsSms Uri's need to originate from dynamic ​methods that are provided. For example to get the Sms.Inbox Uri replace the following:
  
 <code java>​Sms.Inbox.CONTENT_URI <code java>​Sms.Inbox.CONTENT_URI
Line 86: Line 77:
 </​code>​ </​code>​
  
-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.+As a side note, if you create or make static ​variable ​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/dynamic method ​references. ​If you use static ​or variable references ​your compiler will not complain but it will most likely result in runtime ​problems ​for users.
  
 8. Implement the SDMM callback for received messages. This allows you to tell SDMM if your app attempted to abort the incoming SMS. Here is an example: 8. Implement the SDMM callback for received messages. This allows you to tell SDMM if your app attempted to abort the incoming SMS. Here is an example:
install.txt · Last modified: 2015/01/05 02:37 by superdupersms