Pages

Thursday, January 27, 2011

Null Pointer Exception when sending SMS in android


                This is an issue that I came across while developing my android application. The reason in my case was that the size of the message or number of characters in the text message was to large.
                I solved it by sending multiple messages using sendTextMessage(…) method, the other solution would be to sendMultiPartMessage(….).
                It’s a no brainer but it took hours for me to realize the issue. Returning a null pointer exception was little weird. I still can’t understand why this is called a null pointer exception.


if you want to know about receiving broadcast on new SMS arraivals chech this