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
jasmas
Posts: 4
Registered: ‎01-15-2009
My Device: Not Specified
Accepted Solution

Interacting with messaging application

Is there a way to be notified when the messages application is opened?  Also, is there a way to have my application invoked when a user "replies" to a message matching a certain criteria?
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Interacting with messaging application

it is possible that there is a global event. likely not.
you could periodically check ApplicationManager.getForegroundProcessId() to see if the messenger app is in the foreground.
i don't think your second idea is manageable as you have no listener to get into the application context.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Developer
jasmas
Posts: 4
Registered: ‎01-15-2009
My Device: Not Specified

Re: Interacting with messaging application

Anyone know the process id for the Messages application?
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Interacting with messaging application

To answer your question

 

"Is there a way to be notified when the messages application is opened?  Also, is there a way to have my application invoked when a user "replies" to a message matching a certain criteria?"

 

The messages application is always running, and there really isn't any way to determine if the messages list was opened.

 

However, you can get notified when a particular email is opened. Follow these steps:

 

Attach a FolderListener to the Email inbox to be notified when new email arrives.

When you see an email that matches your criteria, attach a MessageListener to the Message object.

 

Now, you will get a notification when this email is opened.

 

 

 

 

 

 

 

Please use plain text.
New Developer
jasmas
Posts: 4
Registered: ‎01-15-2009
My Device: Not Specified

Re: Interacting with messaging application

Appreciate the help.  I wrote a blackberry twitter app (http://bbtweet.googlecode.com) that delivers new twitter messages as new emails.  This seems to be pushing the limits on what the intended use of the api.  I would use the application folders available in 4.6 but I don't want to leave the majority of blackberry users behind.

 

My goal was to deliver tweets as new messagse into the single message view and allow the user to customize notifications in the profiles on the device.  I've accomplished this but I use an immediate notification when new tweets arrive and I need something to trigger a stop immediate notification.  Ideally I would do this when the Messages view is opened to mimick the behavior with email/sms/etc.

 

After reviewing the above, I think I'm going to compromise by sending a stop immediate notification when the app is opened (user is using the device to send a status update) and also when any delivered message is opened (user is obviously reading messages).  This gets me as close to the out of box email behavior as I think I'll be able to get. 

Please use plain text.