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
Developer
Posts: 105
Registered: ‎05-22-2008
My Device: Not Specified

Folder Listener :- App seems to hang

Hi,

 

OS 4.2 on BB 8800. 

 

I have a folder listener and in the messagesAdded() I check to see if the subject contains a keyboard.

If it does, I do some processing..

 

Now when I have > 500 messages in my mailbox, and reboot the device, my device seems to hang.

 

Does this method get called once for each message every time I reboot the device ? (My app is auto start, so

it registers very early as a folder listener)

 

I thought it should get called only for new messages, unless rebooting causes a messagAdded to be triggered

again for each message.

 

 

Has anyone else faced problems with this ?

 

Also over time, my device frequently crashes, if I start off with fewer messages in my inbox, and the size grows.

I am certain its due to the folder listener, but cant seem to find out why, as I just check the subject.

 

 

 

Thanks

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Folder Listener :- App seems to hang

FolderListener.messagesAdded() is only called when a new message is added to the folder.

 

 

 

Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: Folder Listener :- App seems to hang

1. Do you mean your application crashes or your whole device crashes?  Does in shut off or lock up? 

2. Is there anything in your event log such as a stack trace or a forced stack trace of every thread?

3. What happens to your memory usage over time?  Does your memory usage go way up before the app/device crashes? 

Kurt Zettel | Chief Architect | Metova
www.metova.com
Developer
Posts: 105
Registered: ‎05-22-2008
My Device: Not Specified

Re: Folder Listener :- App seems to hang

 

The System E-mail application and messenger application seem to hang.

Sometimes, after staying on the icon for a while, I get a exception dialog, saying that the app is not responding

 

I then need to reboot in order to get e-mail working again.

 

Strangly, my Application seems to work.

 

In anycase, just adding a

 

if(true) { return }

 

to the top of my method (effectively not doing any processing at all) seems to have solved the problem.

 

But now I cant do any processing, so its not really a solution, but I have to axe a feature to get my app to be

more stable.

 

Again this problem seem to appear only when I have a very large number of messages in the system inbox.

 

I have not looked at the system logs (Alt LGLG) in detail, and dont know how to monitor my app memory.

Again, my app seems to work fine..... 

 

 

Thanks.

BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Folder Listener :- App seems to hang

Processor intesive tasks should not be performed within a listener.  Instead, the application can create a new thread to perform this task allowing the listener to continue.  Failing to do so can cause the behaviour you describe.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker