Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Troubleshooting Guide Page 161

  • Download
  • Add to my manuals
  • Print
  • Page
    / 286
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 160
161
10: Using the messages application
Send a message with an attachment
Retrieve information about the
attachment.
> Invoke the methods of the SupportedAttachmentPart class. The
SupportedAttachmentPart class represents an attachment with a corresponding viewer on
the BlackBerry® device. An
UnsupportedAttachmentPart represents an attachment that
does not have a viewer on the BlackBerry device.
public void run(Message m, SupportedAttachmentPart p) {
...
String name = p.getName();
int size = p.getSize();
}
Task Steps
Create a multipart message.
> Create a new Multipart object.
byte[] buf = new byte[256]; // The attachment.
MultiPart multipart = new MultiPart(); // Default type of multipart/
mixed.
Create each component of the
attachment.
>Create a SupportedAttachmentPart object, designating the Multipart object as its
parent.
SupportedAttachmentPart attach = new SupportedAttachmentPart(
multipart, "application/x-example", "filename", data);
Add each SupportedAttachmentPart
object to the multipart object.
>Invoke addBodyPart(SupportedAttachmentPart) on that object.
multipart.addBodyPart(attach); // Add the attachment to the multipart.
Set the content of the attachment. >Invoke setContent(Multipart) on the Message object and pass in the Multipart
object as its parameter.
msg.setContent(multipart);
Send the message. >Invoke Transport.send().
Transport.send(msg);
Task Steps
Page view 160
1 2 ... 156 157 158 159 160 161 162 163 164 165 166 ... 285 286

Comments to this Manuals

No comments

Epson G5550 podręczniki

Instrukcje obsługi i podręczniki użytkownika dla Projektory danych Epson G5550.
Dostarczamy 1 pdf podręczników Epson G5550 do pobrania za darmo według typów dokumentów: Broszura






Więcej produktów i instrukcji dla Projektory danych Epson

Modele Rodzaj dokumentu
V11H665520 Arkusz Danych   Epson BrightLink Pro 1430Wi, 2 strony
V11H620041 Arkusz Danych   Epson EB-1980WU, 2 strony
V11H546041 Arkusz Danych   Epson EB-4650, 8 strony
V11H551040 Arkusz Danych   Epson EB-X18, 2 strony
V11H552020-N Arkusz Danych   Epson EX3220, 4 strony
V11H606140 Arkusz Danych   Epson EB-Z11005, 2 strony
V11H616040 Arkusz Danych   Epson EB-Z9870U, 2 strony
821P Broszura   Epson 821p Product Brochure, 2 strony
V11H546020 Arkusz Danych   Epson PowerLite 4650, 6 strony
V11H582041 Arkusz Danych   Epson EB-955W, 2 strony
EMP 8100NL Instrukcja Użytkownika   Epson EMP 8100NL User's Manual, 117 strony
Z9870NL Dokumentacja   Epson Z9870NL Product Specifications, 2 strony
450Wi Broszura   Epson 450Wi Product Brochure, 18 strony
EMP-7300 Instrukcja Użytkownika   Epson EMP-7300 User's Manual, 121 strony
V11H570040 Arkusz Danych   Epson EB-X20, 2 strony
DREAMIO EMP-TW700 Instrukcja Użytkownika   Epson DREAMIO EMP-TW700 User's Manual, 3 strony
V11H543041 Arkusz Danych   Epson EB-4850WU, 2 strony
V11H581041 Arkusz Danych   Epson EB-945, 2 strony
V11H622041 Arkusz Danych   Epson EB-1970W, 2 strony
V11H555141 Arkusz Danych   Epson EB-X03, 2 strony