This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes sending SMS in j2me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "sending SMS in j2me" Watch "sending SMS in j2me" New topic
Author

sending SMS in j2me

Ilko Ivanov
Greenhorn

Joined: Aug 04, 2011
Posts: 9
Hey guys,
I am using the following code to send SMS in my application. It does work, but it returns FALSE when the message is really sent successfully.
What do you think is causing the problem?



Thank you!


http://www.encodedmessages.com
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
You set your boolean result to true, and it should return true, but look where your result can be set to false: in the catch statement of your try-catch block.

Something is throwing an exception, but what? I don't know. Your catch block has the superclass Exception in it -- it will catch everything, and set your result to false, but not tell you which thing is breaking.

You should check the Java ME API for the details on those methods you are calling. At least one of them is throwing a specific type of Exception that you could test for.
 
Consider Paul's rocket mass heater.
 
subject: sending SMS in j2me
 
Similar Threads
Anybody getting along with wma1.0?
sms app gives security exception
Not able to Receive sms messages in my emulator over port 50000 but able to send
sending sms!
SMS picking phone number from a Numeric field