Re: listening for call events on OS7
Thanks for the reply.
To what I realise is the app exited. I was extending my app from Application and was under the impression that the app would stay running behind... but a vain attempt. If I extend from UiApplication, I can see that it receives the callback.
I went through the RIM online tutorial etc to let my app always running in the bg. RIM suggests to override the onClose of the Screen class to avoid the system exiting the app if the app UI is closed. It also suggests on alternate entry points etc but What if the app is not a UI based?
What I have been trying to achieve here is to write an app that accepts the phone call.
Below is my snippet of code.
public class CAllReceiveApp extends Application implements PhoneListener {
public CAllReceiveApp() {
try {
Phone.addPhoneListener(this);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
public static void main(String[] args) {
CAllReceiveApp app = new CAllReceiveApp();
app.enterEventDispatcher();
}
public void callIncoming(int callId) {
Log.d(TAG, "someone calling");
//System.out.println("Someone calling ...");
// Dialog.alert("someone calling");
}
// ... other overriden methids
}
|