Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem sending port-directed Data SMS on HTC EVO 4G
    text
    copied!<p>I am trying to send and receive port-directed SMS from an HTC EVO 4G to itself using <code>SmsManager.sendDataMessage()</code> and the device is giving a NullPointerException quite deep in the OS.</p> <p>Here is the code that kicks off the exception:</p> <pre><code>manager.sendDataMessage(phonenumber, null, (short) 8091, data,piSend, piDelivered); </code></pre> <p>I think I have the appropriate permissions declared in the manifest:</p> <pre><code>&lt;uses-permission android:name="android.permission.READ_SMS"&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.SEND_SMS"&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.RECEIVE_SMS"&gt;&lt;/uses-permission&gt; </code></pre> <p>Here's the stack trace I'm getting:</p> <pre><code>06-27 11:03:42.144: ERROR/AndroidRuntime(14489): FATAL EXCEPTION: main 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): java.lang.NullPointerException 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.os.Parcel.readException(Parcel.java:1328) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.os.Parcel.readException(Parcel.java:1276) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at com.android.internal.telephony.ISms$Stub$Proxy.sen dData(ISms.java:682) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.telephony.SmsManager.sendDataMessage(SmsMa nager.java:546) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at com.varma.samples.smsdemo.MainActivity.sendSms(Mai nActivity.java:66) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at com.varma.samples.smsdemo.MainActivity.access$0(Ma inActivity.java:50) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at com.varma.samples.smsdemo.MainActivity$1.onClick(M ainActivity.java:98) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.view.View.performClick(View.java:2532) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.view.View$PerformClick.run(View.java:9293) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.os.Handler.handleCallback(Handler.java:587 ) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.os.Handler.dispatchMessage(Handler.java:92 ) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.os.Looper.loop(Looper.java:143) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at android.app.ActivityThread.main(ActivityThread.jav a:4263) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at java.lang.reflect.Method.invokeNative(Native Method) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at java.lang.reflect.Method.invoke(Method.java:507) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:839) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:597) 06-27 11:03:42.144: ERROR/AndroidRuntime(14489): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>If anybody wants to try it out for themselves, I am using the example provided <a href="http://code.google.com/p/krvarma-android-samples/source/browse/" rel="nofollow">here in the SMSDemo project</a>.</p> <p>Can anybody help me out with this?</p> <p><strong>EDIT :</strong> I have just put together a sample J2ME MIDlet to see if I can get it to work as well and it also fails. Does anybody remember any information about port-directed SMS? Is it handled differently on different networks? Is it all just outdated and I need to get with the times? Or is it something that I might be doing?</p> <p>In case SMS is network dependent, I'm using Sprint devices but I'm developing in Canada, so I think they are roaming on Telus.</p>
 

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