BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-17-2012, 09:52 AM   #1
Lukaszz
New Member
 
Join Date: Feb 2012
Model: 9160
PIN: N/A
Carrier: vodacom
Posts: 4
Smile OutboundMessageListener doesn't detect outgoing sms

Please Login to Remove!

Hi, the following piece of code should print out a message when an sms is sent from the device. I've tried it several times on the simulator but nothing gets printed when I send an sms. What am I doing wrong? Why doesn't the app pick up that an sms has been sent?


public class BackGroundApp extends UiApplication implements OutboundMessageListener, javax.wireless.messaging.MessageListener {

private MessageConnection messageConnection;


public static void main(String args[])
{
BackGroundApp theApp = new BackGroundApp();
theApp.enterEventDispatcher();
}

public BackGroundApp(){
try {
MessageConnection _mc = (MessageConnection)Connector.open("sms://");
_mc.setMessageListener(this);

} catch (IOException e) {}

}

public void notifyIncomingMessage(MessageConnection messageconnection){


}

public void notifyOutgoingMessage(javax.wireless.messaging.Mes sage message) {

System.out.println("SMS just sent from your device!");

}
}
Offline  
Old 07-17-2012, 12:10 PM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default Re: OutboundMessageListener doesn't detect outgoing sms

1. You need to register your listener with the MessageConnection per the API documentation.

2. The simulator can't really send SMS messages so you may have to do this on a device.
__________________
My other Blackberry is a PlayBook.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads for: OutboundMessageListener doesn't detect outgoing sms
Thread Thread Starter Forum Replies Last Post
Type SMS on PC > USB > BBerry > wireless network? littlebigman General BlackBerry Discussion 15 11-21-2010 07:44 PM
[New Software] Quicker SMS for BlackBerry Launched Joe Ge Aftermarket Software 8 07-18-2009 07:07 PM
SMS Outgoing Text Today Theme Problem mgerbasio BlackBerry Themes 2 04-08-2009 02:44 PM
SMS, North American Extensions, and Usage. Tom BlackBerry Network 42 01-05-2009 03:52 PM
SMS from BB martin_j001 General BlackBerry Discussion 35 11-25-2005 09:12 AM


Agilent E8403A VXI Mainframe + E8491B, E4808A, 7x E8461B Modules with WARRANTY picture

Agilent E8403A VXI Mainframe + E8491B, E4808A, 7x E8461B Modules with WARRANTY

$3900.00



TEKTRONIX TM5006A 6 BAY MAINFRAME.  (chassis Mainframe only) picture

TEKTRONIX TM5006A 6 BAY MAINFRAME. (chassis Mainframe only)

$200.00



EXFO FTB-500 Mainframe 4 Slot Mainframe Windows 8 picture

EXFO FTB-500 Mainframe 4 Slot Mainframe Windows 8

$999.95



HP 3488A HPIB Switch / Control Unit Mainframe picture

HP 3488A HPIB Switch / Control Unit Mainframe

$24.99



Tektronix TLA704 mainframe, TLA 7L3, TLA 7D1 modules, GHz probes, total system picture

Tektronix TLA704 mainframe, TLA 7L3, TLA 7D1 modules, GHz probes, total system

$499.00



Agilent HP E8404A VXI Mainframe C-Size, 13 Slot 1000W w/E491B, E1472X2 UNTESTED picture

Agilent HP E8404A VXI Mainframe C-Size, 13 Slot 1000W w/E491B, E1472X2 UNTESTED

$499.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.