Blocking outgoing SMS

Is there a way to block outgoing SMS?

Hello

Implement SMS.addSendListener () and return false in the sendMessage method.

Tags: BlackBerry Developers

Similar Questions

  • SMS for outgoing SMS listener throws IOException immediately after the open call

    I had already created a class for sending SMS messages which worked perfectly until I added the listener. When the listener is added as soon as I start the thread throws an IOException exception who am I hurting? The only thing I can think is some kind of wire problem, please help.

    Here's the SMS & Listener class:

    private static final class SmsMessage    {        private String _address;        private String _msg;
    
            public SmsMessage(String address, String msg)        {            _address = address;            _msg = msg;        }
    
            public Message toMessage(MessageConnection mc)        {            TextMessage m = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE,"sms://" + _address);            m.setPayloadText(_msg);            return m;        }    } // SmsMessage
    
       private final class SendThread extends Thread    {        private static final int TIMEOUT = 500; // ms        private Vector _msgs = new Vector(10); // Queue of 10        private volatile boolean _start = false;
    
            // queue requests        public synchronized void send(String address, String msg)        {            _start = true;            _msgs.addElement(new SmsMessage(address, msg));        }
    
            public synchronized void stop()        {            _stop = true;            try {                if ( _mc != null ){                    _mc.close();                }            } // catch (IOException e ) {                catch (Throwable t) {                t.printStackTrace();                System.exit(0);            }
    
            }
    
            public void run()        {            try {                //closed by the stop() method                _mc = (MessageConnection)Connector.open("sms://");
    
                    if (_mc != null)                {                    // set a listener to trap outgoing sms messages                    _mc.setMessageListener(new OutboundSMSListener());                }                for(;;)                {                    while( !_start && !_stop)                    {                        try {                            sleep(TIMEOUT);                        } // catch (InterruptedException e) {                            catch (Throwable t) {                                t.printStackTrace();                                System.exit(0);                            }                    }                    if ( _stop )                    {                        return;                    }
    
                        while(true)                    {                        try {                            SmsMessage sms = null;                            synchronized (this)                            {                                if ( !_msgs.isEmpty() )                                {                                    sms = (SmsMessage)_msgs.firstElement();                                    // take it out of the queue once we sent it                                    _msgs.removeElement(sms);                                }                                else                                {                                    _start = false;                                    break;                                }                            }
    
                                _mc.send(sms.toMessage(_mc));
    
                            } // catch (IOException e) {                            catch (Throwable t) {                                t.printStackTrace();                                System.exit(0);                        }                    }                }            } // catch (IOException e)              catch (Throwable t) {                t.printStackTrace();                System.exit(0);              }        }    } // SendThread
    
        private static final class OutboundSMSListener implements OutboundMessageListener    {        public void notifyIncomingMessage(MessageConnection messageconnection)        {            // we don't care about incoming sms messages right now        }
    
            public void notifyOutgoingMessage(Message message)        {            Dialog.alert("Detected An Outgoing SMS Event");        }    }
    

    Thank you. Makes sense.

  • BlackBerry smartphones to block outgoing I.D. number?

    Sorry if this is a silly question, I'm a total newb.  Is it possible to block my number for outgoing calls?  I just want to surprise someone on Christmas and do not want them to think it's me on their caller ID

    Thank you

    No problem. In fact, click on your phone icon (or it can be called the calls list), or simply press the green phone button as if you wanted to make a phone call. Who will take you on the screen of your phone. Engage with my previous instructions.

  • Outgoing SMS disappears in the air

    Hello

    I send an SMS of my application, but no one ever gets it. No exception is thrown, and the results are expected, but no SMS arrives.

    I open my connection as follows:

    c = (MessageConnection) Connector.open("sms://:0");
    c.setMessageListener(this);
    

    Then later in my code, I try to send an SMS:

    TextMessage txtMessage = (TextMessage) c.newMessage(MessageConnection.TEXT_MESSAGE);
    txtMessage.setAddress("sms://" + number);
    txtMessage.setPayloadText("Test");
    c.send(txtMessage);
    

    number is the number in international format (number is the final string type). The second part is called from a new thread that is started from the implementation of the a PhoneListener callConnected. Something like this:

    public void callConnected(int id) {
        // spawn new thread with above code and start() it
    }
    

    If I don't spawn the thread, I get an exception from thread to send. The code above generates no errors, but no SMS.

    Can anyone make a suggestion?

    Concerning

    Lionel

    Hello

    Thank you for your info once more, I actually just thought to it. SMS code works very well, but there were "", sorry for my ignorance.

    Concerning

    Lionel

  • Number of blocking outgoing calls with blackBerry Smartphones

    new user - with BlackBerry 8520... How can I block my number when you call?  THX, ak

    Press your green dial key to enter the call log.

    Press the Menu key > Options > General settings.

    Scroll down to "restrict my identity = Yes.

    And save.

  • I'm not able to send outgoing SMS promptly

    Hello

    It will say its updated, but you can still repair the phone/software, in case that the problem is the phone not the software on your computer after using the PCC or SEUS you can click on repair or install anyway, but even once, it will delete everything that is stored on the phone (not the SD card)

  • Windows security blocks outgoing e-mail

    All of a sudden, whenever I press 'send all' in Windows Mail, a window named security Windows opens and asked to verify my user name and password. At the top of this window to provide readings to logon to POP3LIVE.COM, I entered the user & P/W for my electronic mail service and it does not accept.

    So what shoul of password/username that I use if not that of my ISP (which is Qwest)?

    Stan Daniels

    Ask your question to Windows Live Solution Center, e-mail discussion forum:

    http://windowslivehelp.com/forums.aspx?ProductID=15

  • TRansmission refused: SendListener

    Hello

    I use the SendListener Interface to block outgoing SMS. Its blocked successfully, but it adds Transmission refused by Application myApplication, before the SMS content. I don't want this message in my blocked SMS.

    Any help is really appreciated.

    Thank you

    Kanak

    There is no way to prevent this.

  • Determining factor in buying the Atrix - SMS font size

    I have a sort of a time reading incoming and outgoing SMS on my iPhone 3G so it's time to upgrade.

    I like the sound of the Atrix and would like to know:

    The release of Gingerbread will allow font changing on the Atrix for incoming and outgoing text messages?

    Is there an "app" that who will now offer just in case where ir isn't?

    I've seen people write about Handcent but I'm not clear if it will do what I need.

    My view isn't ideal for heavy work, that's why I need to increase the font size.

    I'm open to other suggestions of phone Android if you think it will make a difference.

    Thank you.

    M

    I installed it on my phone to test and see and it works very well on the incoming and outgoing messages.

    moggi1964 wrote:Does this mean that incoming messages are not affected by the font change, do you know?
    
  • Audit and account blocking Hotmail

    I have a Hotmail account. My computer operating system is Windows Vista. Can't send email because I have error message "your account has been temporarily blocked. SMS, to check my account on Mobile phone cannot be received because I'm in the area where the service is unavailable. Please help to unlock the account.

    Hello

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums at www.windowslivehelp.com.

  • SMS, DatagramConnection and Sprint

    Why DatagramConnection do not work on the network Sprint (CDMA) for incoming SMS?

    This is the method works on GSM device, but does not work on Sprint (CDMA).

    I use the Port "0" to listen to the incoming text message.

    Find the solution.

    1 cannot use MessageConnection and DatagrammConnection in a single application.

    2. based on OS 4.6 listening to outgoing SMS (CDMA or GSM) I use net.rim.blackberry.api.sms.SendListener and DatagramConnection to listen to memo SMS (CDMA)

    3 GSM work with OutboundMessageListener to listen to the outgoing message and MessageListener entrants.

  • Send SMS by listening for SMS?

    Hello

    I have the following situation - I have a class that implements OutboundMessageListener and listen to incoming and outgoing SMS. Everything works fine, but now I want to send a SMS, but I can't because I can't open a connection on port 0 because it is already in use.

    I tried to use the existing connection, but I can't seem to get an instance of my class. I tried the usual static function with (if (instance == null) instance = new, etc. But the instance is null when I try to find it.

    The second part, I think I can explain, the application has multiple entry points, so impossible to reference an instance created in one window of another.

    Any suggestions? Even if I could stop the listener a while to send the message and then start again, or something like that.

    Concerning

    Lionel

    There are a number of threads here that comes out clearly that a static is NOT a Singleton when the static method is referenced between multiple processes.  Here is a post that summarizes this - just read the first few paragraphs:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=65436#M65436

    There are also a number of Threads which I contributed and who support the other entry is misused

    You'd like to see:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=63894

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=64245&query.ID=12...

    So, I would look first to reduce your requirements for the opening of spare, if you can so your communication problem goes away.  If this is not the case, then use RuntimeStore

  • is it possible to get to info on the cost (and period or number) programmatically conversation/SMS?

    Hi, I was wondering - is it possible to get information programmatically:

    -number of SMS Messages sent

    -number of sent mms

    -How long the user has been talkig

    -How much paid for talk/sms/mms-fondant on filling up the user. is it possible to get the user rate programmatically?

    Kind regards

    To count the number of outgoing sms and mms; implement SendListener.

    From the call duration use call log.

    and take the callcost/min, cost/sms, mms/cost as user input to first launch your application. I have thin in this way you can do your necessary things.

    Press the button Bravo thank the user who has helped you.

    If your problem has been resolved then please mark the thread as "accepted solution".

  • When sending sms, some no-contact. SMS and some no-contact. not get?

    Hi all

    I developed the sms application, when I send the SMS from this application, some no-contact. to sms but some no-contact. do not get.

    can someone help me?

    concerning

    Savi

    Hi all

    I solved this problem. now I can send message to anyone of this sms application.

    If anyone need this app, I'm writing this request here... This works perfectly...

    package sms.savi;

    Net.rim.device.api.ui import. *;
    Net.rim.device.api.ui.component import. *;
    Net.rim.device.api.ui.container import. *;
    Javax.microedition.io import. *;
    Import Java.util;
    import java. IO;
    Javax.wireless.messaging import. *;

    class SmsDemo extends UiApplication {}

    Constants
    // ----------------------------------------------------------------
    private static final int MAX_PHONE_NUMBER_LENGTH = 32;

    Members
    // ------------------------------------------------------------------
    Private EditField _sendText.
    Private EditField _address; A phone number for outgoing SMS messages.
    Private _status EditField.
    Private ListeningThread _listener;
    private SendThread _sender.
    private StringBuffer _statusMsgs = new StringBuffer(); Caching for
    improved
    performance

    private MessageConnection _mc;
    Private boolean _stop = false;

    _sendMenuItem private MenuItem = new MenuItem ("send", 100, 10) {}
    public void run() {}
    String text = _sendText.getText ();
    String addr = _address.getText ();

    If (text.length > 0 () & addr.length () > 0) {}
    Send (addr, text);

    }
    }
    };

    Static
    // ------------------------------------------------------------------
    private static String _openString = "sms: / /"; See connector

    information on the implementation.

    Public Shared Sub main (String [] args) {}
    Create a new instance of the application and the beginning
    the application on the thread of the event.
    SmsDemo sms = new SmsDemo();
    sms.enterEventDispatcher ();
    }

    Inner classes
    // ------------------------------------------------------------
    private class ListeningThread extends Thread {}
    synchronized Private Sub {} stop()
    _stop = true;

    try {}
    If (_mc! = null) {}
    Close the connection so that the thread will return.
    _mc. Close();
    }
    } catch (IOException e) {}
    System.Err.println (try ());
    }
    }

    public void run() {}
    try {}
    _mc = Connector.open (_openString) (MessageConnection); Closed
    by
    the
    Stop()
    method.

    for (; {
    If {(_stop)
    return;
    }

    Message m = _mc.receive ();
    receivedSmsMessage (m);
    }
    } catch (IOException e) {}
    Probably the stream has been closed.
    System.Err.println (try ());
    }
    }
    }

    /**
    * A simple abstraction of an sms message, used by the SendThread class.
    */
    private static final class SmsMessage {}
    private String _address;
    private String _msg;

    private SmsMessage (String address, String msg) {}
    _address = address;
    _msg = msg;
    }

    Private Message toMessage (mc MessageConnection) {}
    TextMessage m = (mc.newMessage) (text)
    MessageConnection.TEXT_MESSAGE, ' / / ' + _address
    + "");
    m.setPayloadText (_msg);

    return m;
    }
    }

    /**
    * A thread to handle outbound transactions.
    */
    private class SendThread extends Thread {}
    private static final int TIMEOUT = 500; MS

    Create a vector of objects SmsMessage with an initial capacity of 10.
    For this implementation, it is unlikely that more than 10 messages
    queued at a time given.
    private vector _msgs = new Vector (10);

    volatile Boolean _start private = false;

    The applications are pending.
    private synchronized {void send (address of the string, String msg)
    _start = true;
    _msgs. AddElement (new SmsMessage (address, msg));
    }

    Termination of the thread.
    synchronized Private Sub {} stop()
    _stop = true;

    try {}
    If (_mc! = null) {}
    _mc. Close();
    }
    } catch (IOException e) {}
    System.Err.println (e);
    updateStatus (try ());
    }
    }

    public void run() {}

    for (; {
    Adjustment of the wire.
    While (! _start &! _stop) {}
    Sleep for a bit so we don't spin.
    try {}
    Sleep (timeout);
    } catch (InterruptedException e) {}
    System.Err.println (try ());
    }
    }

    Exit condition.
    If {(_stop)
    return;
    }

    While (true) {}
    try {}
    SmsMessage sms = null;

    synchronized (THIS) {}
    If (! _msgs.isEmpty ()) {}
    SMS = _msgs.firstElement () (SmsMessage);

    Delete the item so that we don't send it again.
    _msgs. RemoveElement (SMS);
    } else {}
    _start = false;
    break;
    }
    }

    _mc. Send (SMS.toMessage (_mc));
    _mc. Close();
    System.Exit (0);

    } catch (IOException e) {}
    System.Err.println (e);
    updateStatus (try ());
    }
    }
    }
    }
    }

    private class SmsDemoScreen extends form {}

    Constructor
    private SmsDemoScreen() {}
    Dim str As String = "8971833590";
    String = msgStr "How are you?"
    setTitle (new LabelField ("Demo SMS", LabelField.USE_ALL_WIDTH));

    _address = new EditField ("to:", "", MAX_PHONE_NUMBER_LENGTH,)
    EditField.FILTER_PHONE);
    Add (_address);
    Add (new SeparatorField());
    _sendText = new EditField ("Message:", "");
    Add (_sendText);

    /*
    * _status = new EditField(); Add (_Status);
    */

    addMenuItem (_sendMenuItem);
    }

    /**
    Prevent save them dialog box is displayed.
    *
    * @see net.rim.device.api.ui.container.MainScreen #onSavePrompt)
    */
    public boolean onSavePrompt() {}
    Returns true;
    }

    /**
    * Close the application
    *
    * @see net.rim.device.api.ui.Screen #close)
    */
    {} public void close()
    _listener. Stop();
    _sender. Stop();
    Super.Close ();
    }
    }

    Constructor
    private SmsDemo() {}
    _listener = new ListeningThread();
    _listener. Start();

    _sender = new SendThread();
    _sender. Start();

    Screen SmsDemoScreen = new SmsDemoScreen();
    pushScreen (screen);
    }

    /**
    * Update the GUI with the data just got.
    */
    {} private void updateStatus (final String msg)
    invokeLater (new Runnable() {}
    public void run() {}
    Delete the string buffer.
    _statusMsgs.Delete (0, _statusMsgs.length ());
    _statusMsgs.Append (_Status.GetText ());
    _statusMsgs.Append ('\n');
    _statusMsgs.Append (MSG);
    _Status.SetText (_statusMsgs.ToString ());
    }
    });

    }

    /**
    * A simple formatting of received sms message.
    */
    Private Sub receivedSmsMessage (Message m) {}
    String msg_app = m.getAddress ();
    Address of string = m.getAddress ();
    String msg = null;

    If (m instanceof TextMessage) {}
    TextMessage tm = m (text);
    MSG = tm.getPayloadText ();
    }

    StringBuffer sb = new StringBuffer();
    SB. Append("Received:");
    SB. Append ('\n');
    SB. Append("destination:");
    SB. Append (Address);
    SB. Append ('\n');
    SB. Append("Data:");
    SB. Append (MSG);
    SB. Append ('\n');

    updateStatus (sb.toString ());
    }

    private send Sub (String addr, String data) {}
    _sender. Send (addr, data);
    }
    }

    Of

    Savi

  • J2ME allow messages within a time of send/receive SMS

    Hello

    I developed a J2Me application that listens to incoming sms. It sends also outgoing sms. At the start of the application, I opened a connection for incoming messages - now whenever I start the application, the user is asked if he wants to allow:

    "The application xxx has tried to send or receive messages with the network. You want to allow this? Yes/No ".

    Whenever there is an outgoing SMS user is also invited. And even for incoming SMS. It is more problematic, because the application has an autostart (register push) and demand plays a message on incoming messages. But if the user is first asked to receive the SMS, he doesn't know that he has a message, because no alert.

    Now, I tried to find answers, but I have failed. I have set the options to allow (in the advanced options of the system menu) and disabled firewall - still annoying questions.

    It of ok if the user is prompted once, but not every time! How can I prevent this?

    Is related to the ApplicationPermissions class or Code signing?

    Also, there seems to be a bug with the push registry - I can't open a new connection, if the push registry is configured in the jad file. I have to first unregister the event to push, and then open the connection and exit re-enroll the port to push... On other brands, I don't have this problem. Also it seems to work fine if I use the usbloader, but there is an exception at setup time. Also, I can't tell the user to install it with usbloader...

    Would be nice if someone can help me.

    PS: for development I use netbeans and use a jad/jar to cod converter - I hope that's not the problem. I don't want to use the IDE of BB (number porting, like not so, gel, etc.).

    OK, signature (for $20) keys to solve the problem...

    It's the same of menitoned to a few movies tutorial here that this will not solve the problem. It's strange and confusing, but I'm happy that just signature has resolved.

    BTW. I am running Win XP x 64 - .csi is not automatically bound to the signature tool. Also the eclipse installation has not solved... Information inside the post with the keys should mention that simple you can use signatureTool.jar with the keys as a parameter. Why must everything be so clear? :-)

Maybe you are looking for