Note that there are some explanatory texts on larger screens.

plurals
  1. POOpen SMS Send app with parameters in Android 2.2
    primarykey
    data
    text
    <p>I have a problem. Task: Open SMS Send(new message) standard program/window with two parameters: phone number and text body.</p> <p>I founded two solutions:</p> <p>1) </p> <pre><code>Intent intent = new Intent(Intent.ACTION_VIEW); intent.putExtra("sms_body", "SMS text"); intent.putExtra("address", "123456789"); intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); </code></pre> <p>Works fine in all Android emulators 2.x .</p> <p><strong>In real phone with Android 2.2 (possibly 2.3.x) I see only SMS body without phone number</strong></p> <p>2) </p> <pre><code>Uri uri = Uri.parse("smsto:123456789"); Intent intent = new Intent(Intent.ACTION_SENDTO, uri); intent.putExtra("sms_body", "SMS text"); startActivity(intent); </code></pre> <p>Works fine in all Android emulators 2.x too. <strong>In real phone with Android 2.2 (possibly 2.3.x) I see only Phone Number without SMS body text</strong></p> <p>In AndroidManifest.xml:</p> <pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt; &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt; &lt;uses-permission android:name="android.permission.RECEIVE_SMS" /&gt; &lt;uses-permission android:name="android.permission.READ_SMS" /&gt; &lt;uses-permission android:name="android.permission.WRITE_SMS"/&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; </code></pre> <p>Snippets tested on: Samsung Galaxy Tap 7` P1000 with Android 2.2 Motorola Milestone (U.S.A codename: Motorola Droid) Android 2.2 Up3</p> <p>Both methods works well on Android 2.1 (LG GT540 Optimus).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload