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
Guest
Posts: 146
Registered: ‎11-05-2008
My Device: Not Specified

how can I get more than 2 KB size message's body programmitacally/Automore feature

If the message size is greater than 2 KB,then only 2 KB will be shown on BB's body,although checkd on Automore feature.But how can I retrieve the whole message.Please help.Because when i m using getBodyText() method.whole message I couldn't retrieve.How it's possible tio retrieve the whole message.

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

Try to use getContent() method instead of getBodyText()
Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

You can use the Transport.more(BodyPart bp, boolean reqAll) method to request more of a message.  The boolean parameter allows you to specify if you want to retrieve only the next 2 kb or all of the message available.
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
Please use plain text.
Developer
Shubhangi
Posts: 97
Registered: ‎07-17-2008
My Device: Not Specified

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

Hi,

 

Is there any way to know when the more part of the message arrives on the device?

I wanted to get contents of the message as the message arrives in the inbox.That is I need to retrieve the body contents of the message.

  

Once I have recieved the message in the inbox and retrieved it, I am displaying the dialog to user "More all operation is in progress. Please try after some time".But I want to access the message as it arrives into the inbox.

 

Please guide me.

 

Regards,

Shubhangi

 

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

Yes, you can add a net.rim.blackberry.api.mail.event.MessageListener to the message.  This should fire a MessageEvent.UPDATED message when more of the message arrives.
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
Please use plain text.
Developer
Shubhangi
Posts: 97
Registered: ‎07-17-2008
My Device: Not Specified

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

Hi,

 

I have used the MessageListener and I am able to get the event when more of the message gets retrieved.

 

Thank you.

 

 

I had one more doubt regarding adding messagelistener to message. What is the proper way of adding message listener?

Should we add the same message listener to all the messages?

Or for every message we have to add a new message listener?

 

Please guide me.

 

Regards,

Shubhangi

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

You have implemented MessageListener to a class and the same listener you can use it for multiple messages as "Message.addMessageListener(MessageListener)".

Where was the actual confusion.


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
Shubhangi
Posts: 97
Registered: ‎07-17-2008
My Device: Not Specified

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

Hi,

 

Thanks for quick reply.

 

I just wanted to know what will happen if we add new message listener to each message?

 

I have added same  message listener to multiple messages, and it is working fine.

 

 

Regards,

Shubhangi

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

"Add new message listener to each message" this means you want to create a instanse of a class which has implemented MessageListen for each message? If this is the case, you will be creating objects with out any use.

If this is not the case, you can put your sample code how you are planning to add new message listener to each message.

 


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
Shubhangi
Posts: 97
Registered: ‎07-17-2008
My Device: Not Specified

Re: how can I get more than 2 KB size message's body programmitacally/Automore feature

Hi,

Thanks.

 

I am creating the new object of messagelistener only once and then adding it to multiple messages.

 

 

 

Regards,

Shubhangi

Please use plain text.