开发者

Can a native Blackberry application (not MIDlet) use MIDP Push Registry?

If I am writing a MIDlet, and if the device supports SMS push registration (i.e. supports WMA 1.1 spec), I will be able to send push messages to the application that is installed on the phone and is listening to SMS messages at the开发者_JAVA百科 assigned port.

However, if I am writing a Blackberry application, can I still go ahead and use the procedure that applies to MIDP 2.0 devices. If so, can I specify static SMS push registration in JAD file, as we do for a MIDlet? Would the appropriate JAD property be still specified as MIDlet-Push-1:{}?

Another question, that is not totally unrelated is- are there any bulk SMS providers that allow SMS bearers specify the destination ports that can be integrated with this kind of a solution?

Thanks


A regular blackberry application does not support the push registry. You'll have to keep a DatagramConnection open and listen for the incoming SMS messages that way.

DatagramConnection connection = (DatagramConnection)Connector.open("sms://:1234");
Datagram dgram = connection.newDatagram(connection.getMaximumLength());
connection.receive(dgram); // blocking call so this should be in a separate thread
String message = new String(dgram.getData());

where 1234 is the port you're listening on.

As to you're second question I'm not entirely sure, but I think mblox supports port directed SMS.


For the second question, if the bulk SMS service provider provides you with HTTP API which included the UDH field, you can send messages to application listening in that particular port

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜