BlackBerry Forums Support Community

BlackBerry Forums Support Community (
-   Developer Forum (
-   -   OutboundMessageListener doesn't detect outgoing sms (

Lukaszz 07-17-2012 09:52 AM

OutboundMessageListener doesn't detect outgoing sms
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();

public BackGroundApp(){
try {
MessageConnection _mc = (MessageConnection)"sms://");

} 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!");


hrbuckley 07-17-2012 12:10 PM

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.

All times are GMT -5. The time now is 08:20 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.