日期:2014-05-20  浏览次数:20778 次

关于Push的问题,急求高手帮忙......
要实现彩信自动存储功能,我想用Push实现自动接收的,后存储的.可是发现如果我在JAD文件中只注册这个彩信接受Midlet时,当发送端(这个发送端也是J2ME实现的)发送彩信时,接受端的Midlet可以被激活,但是收不到发过来的彩信信息.

JAD文件(只注册一个Push时候)如下:
-------------------------------
MIDlet-1:   MMSReceive,,com.receive.MMSReceive
MIDlet-Jar-URL:   MMSCard.jar
MicroEdition-Configuration:   CLDC-1.1
MIDlet-Push-1:   mms://:MMSReceive,   com.receive.MMSReceive,   *
MIDlet-Version:   1.0.0
MIDlet-Vendor:   Midlet   Suite   Vendor
MIDlet-Name:   MMSCard
MicroEdition-Profile:   MIDP-2.0
MMS-ApplicationID:   MMSReceive
------------------------------------------------------

但是如果我在这个JAD文件中在注册一个用于接受SMS短信MIDLET时候,却可以接受到发送端发过来的彩信信息.

JAD文件(注册多个Push时候)如下:
-----------------------------------------------------
MIDlet-2:   SMSReceive,,com.receive.sms.Receiver
MIDlet-1:   MMSReceive,,com.receive.MMSReceive
MIDlet-Jar-URL:   MMSCard.jar
MicroEdition-Configuration:   CLDC-1.1
MIDlet-Push-1:   mms://:MMSReceive,   com.receive.MMSReceive,   *
MIDlet-Push-2:   sms://:50055,   com.receive.sms.Receiver,   *
MIDlet-Version:   1.0.0
MIDlet-Vendor:   Midlet   Suite   Vendor
MIDlet-Name:   MMSCard
MicroEdition-Profile:   MIDP-2.0
MMS-ApplicationID:   MMSReceive
-----------------------------------------------------

我发现如果把WTK自带的WMADemo的修改成只注册彩信接受MIDLET时,也会出现可以激活程序,当接受不到彩信的情况.
JAD文件修改如下:
------------------------------------------------------
CBS-Message-Identifier:   50001
MIDlet-1:   SMS   Send,   ,   example.sms.SMSSend
MIDlet-2:   SMS   Receive,   ,   example.sms.SMSReceive
MIDlet-3:   CBS   Receive,   ,   example.cbs.CBSReceive
MIDlet-4:   MMS   Send,   ,   example.mms.MMSSend
MIDlet-5:   MMS   Receive,   ,   example.mms.MMSReceive
MIDlet-Data-Size:   0
MIDlet-Description:   This   midlet   demonstrates   WMA   messaging
MIDlet-Jar-Size:   25312
MIDlet-Jar-URL:   WMADemo.jar
MIDlet-Name:   WMA   Demo
MIDlet-Permissions:   javax.microedition.io.PushRegistry,   javax.microedition.io.Connector.sms,   javax.wireless.messaging.sms.receive,javax.wireless.messaging.sms.send,javax.microedition.io.Connector.cbs,javax.wireless.messaging.cbs.receive,javax.microedition.io.Connector.mms,javax.wireless.messaging.mms.receive,javax.wireless.messaging.mms.send
MIDlet-Push-1:   mms://:example.mms.MMSDemo,   example.mms.MMSReceive,   *
MIDlet-Vendor:   Sun   Microsystems,   Inc.
MIDlet-Version:   2.0
MMS-ApplicationID:   example.mms.MMSDemo
MicroEdition-Configuration:   CLDC-1.0
MicroEdition-Profile:   MIDP-2.0
SMS-Port:   50000
------------------------------------------------------
删除了:
MIDlet-Push-1:   sms://:50000,   example.sms.SMSReceive,   *
MIDlet-Push-2:   cbs://:50001,   example.cbs.CBSReceive,   *
并把原来的
MIDlet-Push-3:   mms://:example.mms.MMSDemo,   example.mms.MMSReceive,   *
改成:
MIDlet-Push-1:   mms://:example.mms.MMSDemo,   example.mms.MMSReceive,   *


好像就只有彩信接受会有这种情况,SMS短信就不会有这种情况,刚转行做ME,请高手帮忙指点下,自己实在无法入手了.


------解决方案--------------------
你这个是在真机上测试的?
------解决方案--------------------
似乎看push和wma文档里,没有提到可以用mms来激活程序.
push提供的是:sms,sokcet,datagram,这三种,似乎也没有提到cbs.
lz最好在真机上测试一下吧.