Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
alexey001
Posts: 4
Registered: ‎05-14-2009
My Device: Not Specified

PhoneListener not being called sometimes

Hello!

 

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 :smileyhappy: 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!

 

 

Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: PhoneListener not being called sometimes

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.

----------------
if your issue solved set "Solution" mark at the relevant post
Developer
safycool
Posts: 198
Registered: ‎04-03-2009
My Device: Not Specified

Re: PhoneListener not being called sometimes

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....

 

 

Thanks..

Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800

Re: PhoneListener not being called sometimes

maybe you encountered an exception. and usually if it is not handled properly, there is a possiblity that the listener will stop working. maybe. :smileywink:
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: PhoneListener not being called sometimes

[ Edited ]

Re your two application problem, have a look at the following Thread:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=24334

 

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.

Message Edited by peter_strange on 09-13-2009 06:34 PM
Developer
yako
Posts: 43
Registered: ‎01-20-2009
My Device: Not Specified

Re: PhoneListener not being called sometimes

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.

New Developer
alexey001
Posts: 4
Registered: ‎05-14-2009
My Device: Not Specified

Re: PhoneListener not being called sometimes

Hello!

 

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 :smileyhappy:

 

Sincerely,

Alexey

Developer
safycool
Posts: 198
Registered: ‎04-03-2009
My Device: Not Specified

Re: PhoneListener not being called sometimes

[ Edited ]

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 ?

 

 

Message Edited by safycool on 09-14-2009 12:35 AM