Code Sample: Retrieve The Body Of A Message - Blackberry JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE Integration Manual

Blackberry device applications integration guide
Table of Contents

Advertisement

BlackBerry Device Applications Integration Guide
BodyPart
4. If the
object is of type
MULTIPART_ALTERNATIVE.
if(bp instanceof MimeBodyPart){
5. If the content type of the
object in a
BodyPart
BodyPart xp=mp.getBodyPart(i);
6. If a
BodyPart
object is of type
variable.
if(xp instanceof MimeBodyPart){
7. Check if the content type of the
8. Check if the content type of the
} //end else if

Code sample: Retrieve the body of a message

Object obj=message.getContent();
if(obj instanceof Multipart){
Multipart mp=(Multipart)obj;
if(mp.getContentType().equals(ContentType.MULTIPART_ALTERNATIVE){
for(int i=0;i<mp.getCount();i++){
BodyPart bp=mp.getBodyPart(i);
if(bp instanceof MimeBodyPart){
18
MimeBodyPart
MimeBodyPart mbp=(MimeBodyPart)bp;
Multipart mp=(Multipart)mbp.getContent();
if(mp.getcontentType().equals(ContentType.MULTIPART_ALTERNATIVE){
Multipart
object is MULTIPART_ALTERNATIVE, store a reference to a
variable.
MimeBodyPart
String type=xp.getcontentType();
BodyPart
object is text_html.
if(type.equals(ContentType.TYPE_TEXT_HTML_STRING){
BodyPart
is
}else if(xp instanceof TextBodyPart){
, check if the content type of the
, store the content type of the
// HTML text
}
TextBodyPart
.
// Plain text
Multipart
object is
BodyPart
BodyPart
object in a
String

Advertisement

Table of Contents
loading

This manual is also suitable for:

Java development environment 4.6.0

Table of Contents