I have a Gui-Application and Background-Service that runs on Blackberry device, I need to implement Sms listener that will invoke some Background-Service methods after it's acknowledges that SMS is arrived to the device, after that it will go sleep again.
I have added class to my application and it's looks like that.
import javax.microedition.midlet.*;
import javax.wireless.messaging.*;
public class SmsListener extends MIDlet implements MessageListener {
public void notifyIncomingMessage(MessageConnection conn) {
}
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
public void startApp() throws MIDletStateChangeException {
System.out.println("Hello from midlet");
}
}
When i want to initiate it it's throws me a SecurityException
Might be i am going not the right way?
How do i implement this kind (Sms listener) of Listener in that kind ( Gui-Application and Background-Service) of Application? PS: How do i test it in emulator , how do i simulate sms receiving in EMULATOR??? Thank you in advance.