Adding contacts on the phone

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:

http://supportforums.BlackBerry.com/T5/Java-development/saving-a-contact-in-adress-book/m-p/147727#M...

Tags: BlackBerry Developers

Similar Questions

  • Adding contact to the phone problem

    Hi all

    I'm trying to add a contact to the list of contacts from the phone, able to copy the following 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, contact);
    
         Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, entry);
    
    }
    catch (Exception e)
    {
        System.out.println("erreur ms avt ps disp addContactToRep " + e.getMessage());
        e.printStackTrace();
    }
    

    but I get an exception while debugging, on the line "entry AddressBookArguments = new AddressBookArguments (AddressBookArguments.ARG_COMPOSE, contact);

    The error is: invalid argument

    I am using the code introduced by the api, but it seems that what I wrote is false...

    Could you please help me?

    Thank you.

    Hello

    You can try to climb the PIm.getInstance () to BlackBerryContactList instead of the contact list.

    You may need to change the AddressBookArguments.ARG_COMPOSE of AddressBookArguments. ARG_NEW.

    Hope that will help you.

  • Bought one from Best Buy Apple Watch that had been returned. Original purchaser cannot be contacted. The phone is synchronized to their account, how can I sync to mine?

    Bought one from Best Buy Apple Watch that had been returned. Original purchaser cannot be contacted. The phone is synchronized to their account, how can I sync to mine?

    You can not. Take it back to Best Buy and ask for a refund.

  • Can I export the contacts from the phone or MotoBLUR?

    And before you answer - 'of course, copy them to the SIM card"- I want to EXPORT the contacts from the phone.

    I see that I can import contacts on the phone to CSV on the MotoBLUR page, but I can't export.

    I think that there is a demand of "exportcontacts" in the app store - there can be several - which allows you to export the Android contacts to a CSV file on your SD card.

  • Transferring contacts from the phone to the sim card

    Help. How can I transfer my data from contacts from the phone to the sim card. I have a new phone and this would save back me them all manually. Ray.

    To allow a person to help, can you provide Details view please? as brands and models of phones, etc.

    If Lumia see http://www.microsoft.com/en-us/mobile/support/faq/?action=singleTopic&topic=FA140263 which shows information on how to transfer some details via Bluetooth, etc.

  • BlackBerry store contacts from the phone to the memory card

    Hi all

    I'm new to cascades of blackberry development.

    I want to develop an application where I can store all contacts from the phone to memory card, then plugin this memory card to another blackberry phone and retrieve. Development must be done using waterfalls

    Please tell about how to proceed. Any help/link would be appreciated.

    Thank you best regards &,.

    Tushar

    I would say using the vcard format established for this.

    See
    https://developer.BlackBerry.com/native/reference/Cascades/bb__pim__contacts__contactservice.html?f=...
    and the appropriate import function

  • BlackBerry 10 remote search lack of Contacts in the phone app

    Remote research is available under the dedicated Contact requests, but not under the list of contacts in the phone application. Am I missing a setting or is this a missing feature?

    Hey DHungate,

    Thanks for the question.

    The look-up under the phone app is reserved for local contacts.  Remote research is available in the contacts app in BlackBerry 10.

    Let me know if you have any other questions.

    See you soon.

  • Xperia M4 aqua does not display the names of contact on the phone application

    Hi all

    I jave an Xperia M4 aqua E2306 running Android 5.0. The problem I have is that the Contacts application shows all my contacts synchronize accounts such as Facebook or Google, but the application of the phone itself does not show the names of contacts only contact phone numbers, I went through the settings and I can't find something that will allow me to change this behavior, I deleted the cache of the phone on the settings and rebooted my phone application , but who doesn't. I have many applications installed and downloaded and lots of settings so that I don't want to factory default my phone unless I extremely need of. Any ideas?

    Thanks in advance,

    Jay.

    Factory reset worked just fine. Thank you all :-)

  • BlackBerry 10 Calling of contacts using the phone? Is this possible?

    So, what don't get me?  I use the phone, use the phone contacts icon, select my contacts but I can't understand how to call this contact... the number indicates the contact but I can't find an option to compose...

    I can go to Contacts and select the contact and then select call, but why not in the app phone itself?

    My lamp has done, why not not new/latest smartphone?

    Someone please give me advice on what I'm missing...

    Nevermind... instead of a long press or button, just type... Oh...

  • BlackBerry smartphones lack all the contacts in the phone after the backup (via Desktop Manager)

    Hi - my tour 9630 died, and after getting a new phone from verizon has opened the Office Manager to run the restore. I have now NO telephone contacts at all in my address book, but all my single email yahoo contacts are now in my phone. How can I recover my phone contacts?

    WOW, FIXED! OK, so after playing with the phone for a while, I noticed another problem - I have had wayyyyy too much e-mail contcts; as in every yahoo only contact had synced my phone. so I went Googling issuing telephone directories, options and rset type who turned off Wi - Fi sync. then I restored (for the billionth time) and voila! no more contacts additional email and phone contacts are back.

    Weird question and I wonder if this is normal?

    is it possible to be notified before restoration you must disable your wireless sync (which I didn't even know was)?

    Thank you blackberry forums! you solved my problem again!

  • Adding contacts to the people app

    How can I add contacts from my Yahoo account in the application of people, when Yahoo is not listed as a choice?

    Hello

    You will not be able to add yahoo account or his contact in the people app, given that this option is not available in the people app.

    I hope that answers your question. If you have other problems with Windows, please post in the Microsoft Community. We would be happy to help you.

  • Is there any application to copy contacts from the phone android - att to verizon iPhone SE

    I want to copy all my contacts from my android phone (nexus 5 LG) which is at & t locked on my new iPhone IS which is locked Verizon.

    Is there any application I can use for backup and copy over the clouds. I don't want to add all these contacts 1000 + to my vision of the laptop.

    Assuming that you are syncing contacts on your Android phone with your gmail account, you can just sync them down to the iPhone by adding your gmail account.

  • Contacts display the phone number does not work

    I would like to display the home workplace phone number in the contacts view. Most of my contacts have only a house number or mobile. How can I do this?

    There is a small square button at the top right of your address book component, which, as the identical buttons in Thunderbird allows you to choose the columns that are displayed.

  • 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.

  • BlackBerry smartphones lost my contacts on the phone and cannot get back them.

    My phone has load the other night during a power failure and the morning my contacts and contacts BB disappeared.  These contacts are not lost, because it's my gmail contacts list - but I can't get back them on my phone.  I clicked all the buttons on the sync, but no luck.  I can't manually add a contact and not seeing him.  In the options of the contacts, it says I have 288 contacts associated with my gmail account, and when I manually add one, it goes up by another number.  But - I can't see them anywhere.

    Also, I deleted the email account and set up again ensuring the sync box, took out the battery and SIM card and put back and still nothing.  Advice anyone?

    You see if gmail is your default service for a list of contacts?

    http://BTSC.webapps.BlackBerry.com/BTSC/search.do?cmd=displayKC&docType=kc&externalId=KB11471

    Check the sections under

    For BlackBerry Device Software 4.2 to 5.0 or BlackBerry Device Software 6.0

    If this is the case, then delete the account gmail from your device and set up in this way:

    Since the device, go to mobile.blackberry.com
    Scroll to connect and click Send.
    Click on join now to gmail.  See if the sync works now.

Maybe you are looking for

  • Portege R600 - Modem not found Mobile Broadband

    I just upgraded my R600 to Win 7 & all seems to go well outside of Wireless Manager is no indication ' no high modem mobile broadband ' but in Device Manager I see Tosh F3507g as working properly. Any help appreciated

  • HP Pavilion DV7 BIOS configuration utility - 2010ev:

    Hello I would like to ask if I can change the configuration to another utility or open the Advanced tab of the existing utility No I don't have InsydeH2O Setup Utility v. 3.5 (Locked - no Advanced tab) MOBO is Quanta or HP 3624 HP Pavilion DV7 - 2010

  • Enter the button feels not "catchy".

    I just bought a computer for my mother and is implemented now. It's a HP Dm1z-4035eo with Windows 7 and it's right out of the box. There is a problem with the button enter, has no other buttons have got the eye-catching showdown. The upper part of th

  • "Closing Windows.

    I wake up about 2 times a week, with a blue screen and the "closing windows" across the middle. After that, the button to turn off the computer does not close it. I need to unplug the power cord in order to power off the computer and start again. Why

  • Microsoft survey?

    I just got an email from Microsoft to answer the survey questions 'Insider '. Most of the issues seems too personal. The URL to enter the investigation was https://www.instant.ly/s/eEoyA Is - this legitimate, or a fake survey?