problem adding contacts
Hi all
I am trying to add a contact to the contacts list blackberry dynamically, this is the
code snippet and I get an illegal argument exception, y at - it something that miss me in
the code below, please help me get rid of this problem...
public void savingcontact() { String companyString = detailFields[0].toString(); String firstString = detailFields[1].toString(); String lastString = detailFields[2].toString(); String emailString = detailFields[3].toString(); String phoneString = detailFields[4].toString(); Dialog.alert(firstString+"\n"+lastString+"\n"+emailString+"\n"+companyString+"\n"+phoneString); BlackBerryContactList contactList; BlackBerryContact new_contact; try { contactList = (BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE); new_contact = (BlackBerryContact) contactList.createContact(); if (contactList.isSupportedField(Contact.ORG)) //new_contact.addString(Contact.ORG, PIMItem.ATTR_NONE,"Acme, Inc."); new_contact.addString(Contact.ORG, PIMItem.ATTR_NONE,companyString); if(contactList.isSupportedField(Contact.NAME)) new_contact.addString(Contact.NAME, PIMItem.ATTR_NONE, firstString); if(contactList.isSupportedField(Contact.NAME_FAMILY)) new_contact.addString(Contact.NAME_FAMILY, PIMItem.ATTR_NONE, lastString); if (contactList.isSupportedField(Contact.TEL)) new_contact.addString(Contact.TEL, PIMItem.ATTR_NONE, phoneString); if (contactList.isSupportedField(Contact.EMAIL)) new_contact.addString(Contact.EMAIL,PIMItem.ATTR_NONE, emailString); try { // commits it to the list and the native database new_contact.commit(); } catch (Exception e) { // failed committing the contact System.err.println("This application cannot add the contact info"); } contactList.close(); } catch (Exception e) { // failed to close the list Dialog.alert(e.toString()); } }
Thanks in advance
You set the field name to evil.
Here's an example shot the javadocs.
if (contacts.isSupportedField(Contact.FORMATTED_NAME) contact.addString(Contact.FORMATTED_NAME, PIMItem.ATTR_NONE, "Mr. John Q. Public, Esq."); if (contacts.isSupportedArrayElement(Contact.NAME, Contact.NAME_FAMILY)) name[Contact.NAME_FAMILY] = "Public"; if (contacts.isSupportedArrayElement(Contact.NAME, Contact.NAME_GIVEN)) name[Contact.NAME_GIVEN] = "John"; contact.addStringArray(Contact.NAME, PIMItem.ATTR_NONE, name);
Tags: BlackBerry Developers
Similar Questions
-
BlackBerry Smartphones problem adding Contacts to my BB8530
I don't know when it started, I guess shortly after a problem of low humidity, but I was not able to add contacts to my blackberry for almost maybe 3-4 months now. Whenever I click on new contact, my phone blocked n I have to restart. Any ideas on how to solve this problem I don't want to do a complete reset if I have.
fuumarhys wrote:
I don't know when it started, I guess shortly after a problem of low humidity, but I was not able to add contacts to my blackberry for almost maybe 3-4 months now. Whenever I click on new contact, my phone blocked n I have to restart. Any ideas on how to solve this problem I don't want to do a complete reset if I have.
Hi fuumarhys,
Remove Live Messenger and Yahoo Messenger.
Thank you.
-
Problem adding contacts to the directory blackBerry Smartphones
Hello!
I have a two year old curve 8520. Suddenly, I am facing a problem. I'm not able to add a new contact or edit existing contact. I rebooted my phone number of times but the problem persists. How can I solve this?
Why not try to remove "YM", delete it.
Not sure, is that Yahoo Messenger or YouMail?
Remove it from your applications.
Reset.
Retest the addressbook.
-
Hello world
in my application I want to save the contacts to the phone, this part works perfectly.
My problem is when I add contacts to the phone, for example research in the forum I found this link: http://supportforums.blackberry.com/t5/Java-Development/Problem-adding-contact-to-phone/m-p/341728/h...
There, I found this code:
try { ContactList contacts = null; try { contacts = (ContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE); } catch (PIMException e) { // An error occurred return; } Contact contact = contacts.createContact(); String[] name = new String[ contacts.stringArraySize( Contact.NAME ) ]; name[Contact.NAME_GIVEN] = "Kate"; name[Contact.NAME_FAMILY] = "Turner"; contact.addStringArray(Contact.NAME, Contact.ATTR_NONE, name); AddressBookArguments entry = new AddressBookArguments(AddressBookArguments.ARG_COMPOSE to AddressBookArguments.ARG_NEW, contact); Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, entry); } catch (Exception e) { System.out.println("erreur ms avt ps disp addContactToRep " + e.getMessage()); e.printStackTrace(); }
with this code, I can add a contact... but one by one and the user to save this contact.
How can I add all the contacts I need automatically?
PS: Sorry for my English.
I found the answer here:
-
Search for blackBerry Smartphones recently added contacts.
Hello everyone.
I am a new Member of this community and I hope that someone here will help me solve my problem.
I have Backberry Pearl and I 2520 saved in contacts. But about 10 months before, I had added 2 very important contacts in it but now I forgot the name and the number of contacts that I saved.
So, is there is any solution find recently added contacts or there any third-party application because I still have to deal with these types of problems.
Help, please!
Hello Sakcha!
Welcome to the Blackberry Support Forums.
There is no solution for this in Blackberry.
But it's possible only i9f you install Zebrost directory that is. ZPB software in your Blackberry from www.zebrost.com or directly from your Blackberry.
After installing zpb, you must follow these steps to find recently added of zpb - contacts
1. go to the zpb of your blackberry contact list.
2 assume that you want to search the contacts that you added in the last 10 days, and then type a #10, for added contacts in the last 15 days type a #15 and so on in your contacts list.
It is very useful and amazing software. For the detailed information visit software - www.zebrost.com
-
I'm unable to delete obsolete email addresses of mail. When I change a card email address Contacts outdated address appears at the top of the queue. Is it a problem of Contacts or a mail problem. How to solve this problem?
Have you tried to go to the recipients of mail/window/previous and delete e-mail addresses it?
-
Question of Safari and Chrome. indicates on the navigation screen. "An element of the Protection of the family filter does not work as expected. Restart your computer. If the problem persists, contact support. Error: failed to hose CPI. »
Quit Safari, Chrome to quit smoking. If necessary Forcequit.
Start Safari while holding the SHIFT key, select the menu Safari ClearHistory, then after this check that the homepage is the one you want.
Do the same for Chrome.
Close all browsers, restart the mac.
-
Windows cannot load the locally stored profile. Possible causes of this error include insufficient security rights or a damaged local profile. If the problem persists, contact your network administrator.
My documents are 'hidden' alsoxpconfused,
This article explains how to solve problems with a corrupted profile. Article After return your results. Mike - Engineer Support Microsoft Answers
Visit our Microsoft answers feedback Forum and let us know what you think. -
I get a message "Module PC Doctor has encountered a problem. If the problem persists, contact Microsoft. »
I've just updated all the security tools and performance of PCTools and still get the message. The error report ask if I want to send a report and I do often, but I have had no contact from Microsoft.
I contacted PC Tools, but theyt haven't bee able to solve the problem no more.
MCSoriginal title: error pctdoctorIt is in the Vista forum, but the same applies.
you run analyses:
Download, install, update and scan with these full free malware detection programs:
Malwarebytes (MMFA): http://malwarebytes.org/
SUPERAntiSpyware: (SAS): http://www.superantispyware.com/
http://www.Microsoft.com/security/scanner/en-us/default.aspx Security Scanner
a report sent to Microsoft does not require a response, it is used to determine if a fix is needed after numerous reports of errors are sent.
This is probably due to malware.
What is the brand and model of the pc, current antivirus, operating system and service pack?
-
When I try to use the Snipping Tool I get a message saying that "the capture tool doesn't on your computer right now. Restart your computer and try again. If the problem persists, contact your system administer. »
What can I do to fix this?
Thank youHi Palaimo,
See if one of the patches in the following link works for you.
Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]
-
Hello
I have problem launching Contacts and applications Taksks on my BB Bold 9900 after OS updated on-air 7.1 Bundle 2508 (v7.1.0.912, platform 5.1.0.641).
The Contacts app is crash after trying to launch it's and not display anything (previous armored content is displayed). I have to press
to close the application and return to the screen notrmal. The tasks app isn't launched and display error message: Eception exception: context of entry has a component of input null - apparentely focusGained has not been called by UiEngine.
It's not disappear, even I reboot the device, remove the battery or wipe it.
Can someone help me?
Kind regards
Artyom.HM, if I try to start tasks app with English as the language of current entry - this app has started without problem. Current developments in Russian language - prevent to start this application. Also if I delete files from Russian support of device using desktop - contacts and tasks soft application works ok without problem. May there are Russian software bug in support files.
-
When I extend the path of visual studio 2012 from 30 days to 90 days. I get this.
Sorry, but we were not able to process your request. Please try again. If this problem persists, contact Microsoft Support for assistance.
Hi azeshMahato,
Thanks for posting your question in the Microsoft Community. I suggest that you this post in the Visual Studio MSDN Forums.
http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio,
-
error 0 x 4001100200001005 if the problem persists contact the Dell technical support
System - Dell inspiron 15 R 5521, windows 8, intel 1.8 GHz i5 cpu 3337U
My HARD drive crashed 3 weeks ago, so I'm trying to install windows on my new HARD drive 8 my DVD backup created by the recovery and backup dell. I constantly get this error "error 0 x 4001100200001005 if the problem persists contact Dell support.
In reading several threads on this forum, it seems that I need to windows OEM disks , but I can't find any disk (except suite multimedia cyberlink dvd) in the box of my laptop. Please help me I am stuck with the system of death. I don't want to buy a new license of windows.
Finally I solved this problem and for anyone with similar problems I share the solution
The problem in my case is that my DVD backup has been corrupted (I don't know how) and so the error 0 x 4001100200001005 is coming
Now the problem is How to restore an OEM (preinstalled) windows if you lose the HARD drive and backup
First of all remember that the Windows preinstalled on your system comes with a key. If you do not have a physical backup of key do not worry your System Bios will be the key embedded in them. So even if you lose your HARD drive, you can still recover your key of any software, as show touches them more.
Here are the steps to reinstall a windows OEM
1 get your key to windows by any software (R/W all or show key etc..)
2. also note the version of your original windows as Home, professional, business, or other unique language. It is essential to know the exact version of your windows or the key will not work.
3. now download the same version of windows from anywhere (as getintopc.com)
4. take in any mount external drive the ISO file and run the Setup program
5. now, here's a Tip - when windows prompts you for a key, do not enter your OEM key not because she will reject everything just saying is not the correct key for this version of windows (I don't know why?)
Instead of your key Windows keys generic to complete the installation.
6 now's done it once your windows is installed, you can go to computer > properties and activate windows to connect to an internet connection (easier) and if you have no internet try the phone activation (use your key has been recovered while activating and not the generic key).
That's all
Hope It will help someone. :)
-
I have a Zune and Windows drive * on my desk. Everything worked fine until today while I got the following messages. In Zune: "Error reading the Zune software cannot access important data on your Zune. Try to disconnect and reconnect it. If the problem persists, contact customer support. "" Then on the computer: "USB device not recognized." "
I have a Zune and Windows drive * on my desk. Everything worked fine until today while I got the following messages. In Zune: "Error reading the Zune software cannot access important data on your Zune. Try to disconnect and reconnect it. If the problem persists, contact customer support. "" Then on the computer: "USB device not recognized." "
Message error "the Zune software cannot access important data on your Zune.
-
I can not download the trial version after effects CC show me a message in the page: we are experiencing some problems, please try again later. If the problem persists, contact customer support.
[Ask in the correct forum allows... Left non-technical Forum Lounge for forum specific program... MOD]
Maybe it's a false error that hides the real problem... a 32-bit computer
You MUST have a 64-bit computer and operating system... What is your computer?
-http://windows.microsoft.com/en-AU/windows7/find-out-32-or-64-bit
-Programs are supposed TO not view or download if they are not installed on your computer
-http://helpx.adobe.com/creative-cloud/kb/all-apps-displayed-aam.html
MINIMUM for After Effects and Premiere Pro http://helpx.adobe.com/premiere-pro/system-requirements.html
Maybe you are looking for
-
Audio system on MacPro early does not.
A symbol of the "oblique/circle bar" appears on the screen when I press the volume to the top or to the bottom of the key. I just reinstalled Yosemite after an accident on my MacPro (2008). Everything else works fine.
-
Why AutoSave does not work?
My speech has stopped its work of automatic backup. If I saved the file once or not, I'll have more in more frequent crashes and all the work disappeared. I reinstalled the software and updated, but the problem is recurring. Ideas? (A hint: I always
-
Is there a way to disable the thumbnails that appear in the Skype chat? I need to be able to see when an image is sent then is it possible to return it when he appeared as a file transfer. I can't seem to find an option to disable the thumbnails, I t
-
on the guarantee to operatin system
Mr President If at all... I update to windows 8.1 have guaranteed with my windows 8. windows 8.1 hangs on... am I going to get the support of HP to warranty...
-
DESKJET 3636: Once again, problems with drivers, ob! DESKJET 3636
Here we are I am still here to complain for the installation of the drivers, this time with Win10 and a new printer, but the same question that in past. It seems that HP engineer have used bad and strange to pursue a way to write the drivers which co