1

Is there any way to send SMS text messages on BlackBerry 10 using the Android SDK, since according to BlackBerry documentation for Android apps SMSManager and SMSMessage hardware features are not supported?

Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
Mano
  • 517
  • 1
  • 8
  • 21
  • The link in the question is broken. This link may be better: http://developer.blackberry.com/android/apisupport/unsupported_api_jellybean_hardware.html – PVS Dec 26 '14 at 16:07

1 Answers1

1

It appears that this only works on Dev Alpha devices running 10.9.10.35 or later. The following intent to launches the standard messaging app, including a target phone number and body text:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android-dir/mms-sms");
intent.putExtra("address", adress);
intent.putExtra("sms_body", text);
startActivityForResult(intent, 0);

The documentation seems to suggest that this is disallowed, but nevertheless it works:

Android applications cannot provide system-wide services to the rest of the device. E.g:

  • Dialing services (handling android.intent.action.ACTION_DIAL)
  • Viewing capabilities (system-wide handing of android.intent.action.ACTION_VIEW)
  • Data sharing capabilities (android.intent.action.ACTION_SEND)

I discovered the native package name that handles the intent by querying the components that accepts it, which revealed:

com.rim.messaging.NativeSmsMms

Sure enough, launching it works as expected:

Intent intent = new Intent();
intent.setComponent(new ComponentName(
        "com.rim.messaging",
        "com.rim.messaging.NativeSmsMms"));
startActivityForResult(intent, 0);

Beware that the Android version is not present and hence the following intent will not work:

Intent intent = new Intent();
intent.setComponent(new ComponentName(
        "com.android.mms",
        "com.android.mms.ui.ComposeMessageActivity"));
startActivityForResult(intent, 0);

I initially thought this wasn't possible after testing on our Dev Alpha device, but evidently it was originally shipped without the Text Messages app. Go figure.

Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
  • Intresting report, thank you for your answer my friend. I will do some tests, when I have a bb10 device and if you are right I'll mark the question as solved. Thank you again. – Mano Feb 12 '13 at 15:20
  • I just did another test using the contact list, and also there nothing happens. I'll test again in the morning. – Paul Lammertsma Feb 12 '13 at 16:32
  • Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setType("vnd.android-dir/mms-sms"); intent.putExtra("address", phoneNumber); Just created an intent that way, and I run the code on a device and I didn't had any errors, I didn't had any SIM card to fully test it decently thought. Could you give it a shot in my place? – Mano Feb 15 '13 at 09:37
  • I accidentally swapped the component names in the post above; corrected that. Android accepts the first and third solution, BB10 only crashes on the last. I'm testing with a SIM in just a moment. – Paul Lammertsma Feb 15 '13 at 12:09
  • No, the SIM card appears to have no effect. A software update is available for our Dev Alpha. I will follow up if I get the green light to update it. – Paul Lammertsma Feb 15 '13 at 12:26
  • I contacted RIM, and while they couldn't responded concerning the specific issue, they mentioned that messaging should work on the Dev Alpha device. It doesn't, but I haven't gotten around to updating. Will do soon. – Paul Lammertsma Mar 05 '13 at 17:48
  • After the upgrade to 10.9.10.35, the built-in contact app started working! Even better news is that I found one RIM-specific method and one generic way to get the intent to fire correctly! I've updated my answer to reflect my revised findings. – Paul Lammertsma Mar 05 '13 at 18:18
  • Just bought a real device, and your code works decently. Thank you. – Mano Mar 13 '13 at 10:25