i`m make a j2me application to receive n send sms, it can successfully send sms but when i try to send sms with WTK 3.0 my application didn't receive any sms,
i had setting the push registry + my sms application send n receive sms only in specific port (port 4999).
maybe my code or my push registry setting is wrong...
[spoiler=code midlet]
package kode; import javax.microedition.io.Connector; import javax.microedition.lcdui.*; import javax.microedition.midlet.*; import javax.wireless.messaging.*; /** .... */ public class smsbeta7a extends MIDlet implements CommandListener, Runnable, MessageListener { //---------------------- public static MessageConnection conn; private boolean sp = true; private BinaryMessage bm; private Message pesan ; private Thread inComeSMSthread; public static String IsiPesan = "", infoVersion = "", hexadekrip; public static byte[] IsiPesan2 ; //---------------------- public smsbeta7a() { display = Display.getDisplay(this); } public void startApp() { menuutama(); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void menuutama(){ recordIN.cekInbox(); recordOUT.cekOutbox(); menu.menu_utama(); if(conn == null) { try { conn = (MessageConnection) Connector.open("sms://:4999"); conn.setMessageListener(this); } catch(Exception er){} } startNewThread(); listmenu.setCommandListener(this); display.setCurrent(listmenu); } //------------------------thread nerima sms---------------------------------------------------------- rujakcendol4 s1 = new rujakcendol4(); rujakcendol4 s2 = new rujakcendol4(); public void run() { while(sp==true) { try { pesan = conn.receive(); if(pesan!=null) { nM++; String alamat = pesan.getAddress(); if(pesan instanceof BinaryMessage) { bm = (BinaryMessage) pesan; IsiPesan = new String(bm.getPayloadData()); String tgl = bm.getTimestamp().toString(); recordIN.tambahRecord(no,IsiPesan,tgl,"belum"); if(display.getCurrent() == listmenu) menuutama(); smsbeta7a.al2 = new Alert("Inbox",nM+" pesan diterima, baca sekarang?",menu.gbr7,AlertType.CONFIRMATION); smsbeta7a.al2.addCommand(cmdopenIN); smsbeta7a.al2.addCommand(cmdbackmenu); smsbeta7a.al2.setCommandListener(this); display.vibrate(200); display.setCurrent(al2); pesan=null; } } }catch(Exception er){} } } public void startNewThread() { inComeSMSthread = new Thread(this); inComeSMSthread.start(); } public void notifyIncomingMessage(MessageConnection mscon) { if(inComeSMSthread == null) startNewThread(); } //--------------------------------------------------------------------------------
[/spoiler]
i`m novice in j2me, please correct my code or something ...
sorry 4 my bad English
thx in advance