BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 09-11-2008, 10:10 AM   #1 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8800
PIN: N/A
Carrier: vodafone
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Use PIM.getInstance().toSerialFormat to creat a vcard bytestream

Please Login to Remove!

Hi everybody
I've got a problem when I used PIM.getInstance().toSerialFormat to creat a bytestream with the form of vcard 2.1. Actually, the code is running well on the simulators; but when I tried to run it on the device(8800), the first 5 or 6 contacts could be well created and then it will get an error (IndexOutofBoundsExceptions) at this setence;
But on the simulator I've tested with a bigger size and a bigger length (contacts);
could anyone give me some suggestion? I'm really crazy for this...

My code:

try
{
ContactList contactList = (ContactList)PIM.getInstance().openPIMList(PIM.CON TACT_LIST,PIM.READ_ONLY);
Enumeration enumer = contactList.items();
while (enumer.hasMoreElements())
{
Contact contact = (Contact)enumer.nextElement();
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
PIM.getInstance().toSerialFormat(contact, ostream,"UTF8",dataFormats[0]);
}
}
catch (Exception e)
{
e.printStackTrace();
}
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Shooter PromPro byLogical Devices EPROM Programmer EEPROM RS-232 Serial DB-25
$197.25
Shooter PromPro byLogical Devices EPROM Programmer EEPROM RS-232 Serial DB-25 pictureLogical Devices Shooter PromPro EE/EPROM Programmer Spectra 400 EEPROM Serial
$224.99
Logical Devices Shooter PromPro EE/EPROM Programmer Spectra 400 EEPROM Serial pictureSMAKN® USB Programmer CH341A Series Burner Chip 24 EEPROM BIOS LCD Writer 25 SPI
$13.83
SMAKN® USB Programmer CH341A Series Burner Chip 24 EEPROM BIOS LCD Writer 25 SPI picture10pcs AT24C04 24C04 Serial EEPROM SOP-8 yq
$0.99
10pcs AT24C04 24C04 Serial EEPROM SOP-8 yq pictureNEW MITSUBISHI FX-EEPROM-4 MEMORY CASSETTE , Free and Fast Shipping
$40.99
NEW MITSUBISHI  FX-EEPROM-4  MEMORY CASSETTE , Free and Fast Shipping picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.