English 中文(简体)
Blackberrysimulator - receive an sms in my Blackberry application without inform in Box
原标题:Blackberry simulator - receive an sms in my Blackberry application without notifying inbox
  • 时间:2011-11-09 12:08:43
  •  标签:
  • blackberry

在此,我使用了黑莓模拟器8520。 我想在我的黑莓申请中收到一ms,而不必通知盒子(沉默)。

UiApplication.getUiApplication().invokeLater(new Runnable()
{
    public void run() 
    {
        // TODO Auto-generated method stub      
        try
        {
            DatagramConnection dc =(DatagramConnection)Connector.open("sms://");

            for(;;)
            { 
                Datagram d = dc.newDatagram(dc.getMaximumLength());
                dc.receive(d);
                byte[] bytes = d.getData();
                String address=new String(bytes);
                String msg = new String(bytes);
                String message=msg.toString();
                add(new RichTextField(message));
                add(new RichTextField(address));
         }
         catch(Exception e)
         {
             e.printStackTrace();   
         }
    }
});
最佳回答

The SMS message will have to be sent to a port other than port 0 (the default) Connector.open("sms://:1500"); and your program will have to be listening on the port when the message arrives. If you send an SMS message from a BlackBerry to a port other than 0 it is actually sent to 0 or the port specified so if there is no server listening to the port the message is delivered to the inbox.

问题回答

暂无回答




相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签