19
3: Work with a message
String type=bp.getcontentType();
if(type.equals(ContentType.TYPE_TEXT_HTML_STRING){
// HTML text
}
else if( bp instanceof TextBodyPart){
// Plain text
} //end else if
}//end if
}// end for loop
}end if
else if(mp.getContentType().equals(ContentType.MULTIPART_MIXED){
for(int i=0;i<mp.getCount();i++){
BodyPart bp =mp.getBodyPart(i);
if(bp instanceof MimeBodyPart){
MimeBodyPart mbp=(MimeBodyPart)bp;
Multipart mp=(Multipart)mbp.getContent();
if(mp.getcontentType().equals(ContentType.MULTIPART_ALTERNATIVE){
BodyPart xp=mp.getBodyPart(i);
if(xp instanceof MimeBodyPart){
String type=xp.getcontentType();
if(type.equals(ContentType.TYPE_TEXT_HTML_STRING){
// HTML text
}
else if(xp instanceof TextBodyPart){
// Plain text
} //end else if
}//end if
}//end if
Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Page 4: ......
Page 7: ......
Page 10: ...10 BlackBerry Device Applications Integration Guide...
Page 12: ...12 BlackBerry Device Applications Integration Guide...
Page 50: ...50 BlackBerry Device Applications Integration Guide...
Page 56: ...56 BlackBerry Device Applications Integration Guide...
Page 65: ......
Page 66: ...2008 Research In Motion Limited Published in Canada...