05-14-2009 07:18 PM
We have a strange problem with a PhoneListener. Sometimes the system just stops calling it.
Our UiApplication registers the PhoneListener and does requestBackground().
On a phone event, PhoneListener (it then runs in PhoneApp process) calls requestForeground() inside invokeLater() in our app.
Our application pops up, displays some UI, gets input from the user and does requestBackground(). We override close() methods in our screens so System.exit() is not called.
Everything works perfectly 99.9% of the time. However some customers (mostly OS 4.6) notice that the PhoneListener stops being called after a while. We do printouts to Event Log. They just stop at some point.
Of course, we cannot reproduce the problem in any of the simulators or on our devices everything functions properly.
Is there a situation when the system can just remove a PhoneListener or stop calling it? Is there a hidden System.exit() that can happen (similar to the one in Screen.close() that we override)?
Any help will be highly appreciated!
05-15-2009 12:57 AM
I think no-one, except of RIM staff can say that there is a hidden System.exit(0) on a certain condition or something like that.
Device OS binaries functionality is not documented nor commented.
Try to update device os and check this issue on updated device software.
09-13-2009 02:19 AM
I am also facing the same problem....sometimes the phonelistener stops responding....Is System.eixt() being called from somewhere ?
Another problem which I am facing is....
I have developed 2 applications which uses AbstractPhoneListener.... When I install both the application on BLackberry Bold 4.6 OS the Phonelistener stops functioning....
How can i avoid this....
09-13-2009 01:33 PM - edited 09-13-2009 01:34 PM
Re your two application problem, have a look at the following Thread:
Also with 4.6, my experience is that one of the API's returns a phone number, with some extra characters (non numeric, in fact non ASCII) at the start of it. This might be causing your listener to blow up? Just a thought.
09-13-2009 05:26 PM
Just to add Peter's comments regarding the extra character issue, it will also add the contact name if the phone number is match of someone in the contact. So when you're trying just get phone number, account for that as well and account for people using numeral in name for whatever reasons.
ie: Just1n or Mich43L or My Home 2.
09-13-2009 10:33 PM
Thank you for your comments. We made a very simple test case catching all the exceptions in the listener and normalizing the phone numbers. The problem still appears on some devices.
We did not find a proper solution. However we did find a workaround that helps _sometimes_. After your PhoneListener is called, you can try removing it and then adding a new one. This "refreshing" helps on some devices and the new PhoneListener is called on the next phone call.
And talking about inconsistent behavior... Try getting the phone number from the dialer in ApplicationMenuListener. On some versions you get a String with the phone number, on some (including the latest OS versions) you get null and you have to traverse the UI hierarchy of the Dialer to extract the phone number
09-14-2009 12:30 AM - edited 09-14-2009 12:35 AM
Hi can you give me some snippet to get the number from Dailer using ApplicationMenuListener...I was unable to find the ApplicationMenuListener in the document.
As far 2 as applications are concerned the other Thread pointed by peter_strange, It says its a known issue.
If I register and unregister the phonelistener will it work properly for 2 applications which are using phonelistener ?