Problem in Sending a SMS

1 view
Skip to first unread message

Romin Irani

unread,
Oct 12, 2011, 3:05:41 PM10/12/11
to Thrutu Developers
I have created a simple Thrutu Button which launches an Activity in
Android when it is selected.

From this activity, I want to send across a SMS to the recipient or
caller - just like how the Map (Where I am) button does.

I have ensured that for this activity, the following entry is present
in the AndroidManifest.xml file:
<meta-data android:name="one way capable" android:value="true" />

Now in the activity on the click of a button, I want to send the SMS.
So I tried launching the SMS as mentioned in the Reference guide as
follows:

In the OnClick of a button, I try to send the SMS as follows:

Intent iSendSMS = new Intent(ThrutuServiceInterface.ACTION_SEND_SMS);
iSendSMS.putExtra(Intent.EXTRA_TEXT, "My SMS Text goes here");

iSendSMS.putExtra(ThrutuServiceInterface.EXTRA_CORRELATOR,getIntent().getExtras().getString(ThrutuServiceInterface.EXTRA_CORRELATOR));

iSendSMS.putExtra(ThrutuServiceInterface.EXTRA_CONNECTION_MODE,getIntent().getExtras().getString(ThrutuServiceInterface.EXTRA_CONNECTION_MODE));
startActivity(iSendSMS);

But this results in the following exception which I reproduce from
LogCat:


10-13 00:34:01.915: ERROR/AndroidRuntime(27539): FATAL EXCEPTION: main
10-13 00:34:01.915: ERROR/AndroidRuntime(27539):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=com.thrutu.SEND_SMS (has extras) }
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:
1408)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.app.Instrumentation.execStartActivity(Instrumentation.java:
1378)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.app.Activity.startActivityForResult(Activity.java:2817)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.app.Activity.startActivity(Activity.java:2923)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
com.thrutu.example.TextChat.SendReminderActivity
$1.onClick(SendReminderActivity.java:36)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.view.View.performClick(View.java:2408)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.view.View$PerformClick.run(View.java:8816)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.os.Handler.handleCallback(Handler.java:587)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.os.Handler.dispatchMessage(Handler.java:92)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.os.Looper.loop(Looper.java:123)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
android.app.ActivityThread.main(ActivityThread.java:4633)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
java.lang.reflect.Method.invokeNative(Native Method)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
java.lang.reflect.Method.invoke(Method.java:521)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:858)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-13 00:34:01.915: ERROR/AndroidRuntime(27539): at
dalvik.system.NativeStart.main(Native Method)


Question : What entries need to go in the AndroidManifest.xml to
handle this ?

Kindly revert back at the earliest to help me complete my submission.
Thanks in advance.

Cheers
Romin

Charlie Stedman

unread,
Oct 19, 2011, 7:18:04 AM10/19/11
to Thrutu Developers
Hi Romin,

Can you confirm where in your manifest file you are putting the "one
way capable" meta-data? It should go inside the <service> or
<activity> tag that defines your button.

Cheers,
Charlie

Romin Irani

unread,
Oct 19, 2011, 7:21:41 AM10/19/11
to thrutu-d...@googlegroups.com
Hi Charlie,

Thanks for the email. Actually I ended up with my own activity to send out the SMS. 

But to answer your question, I did put the "one way capable" meta-data inside the <activity> tag.

Thanks
Romin
Reply all
Reply to author
Forward
0 new messages