Examples of BlackBerryContact


Examples of net.rim.blackberry.api.pdap.BlackBerryContact

       
        try {

            BlackBerryContactList list = (BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);

            BlackBerryContact contact = getContact(record.getKey(), list, modify);

            if (contact == null) {
               
                Dialog.inform("BlackBerryContact is null.");
                return null;
            }
           
            String content = fixTag(record.getUid());

            ContactParser parser = ParserFactory.getParserInstance(list, contact, modify);

            parser.parseContact(content);

            contact.commit();

            String uid = contact.getString(BlackBerryContact.UID, 0);

            record.setKey(uid);

            list.close();
           
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

        if(!modify) {
            return (BlackBerryContact)list.createContact();//casting added
        } else {
            Enumeration enumeration = list.items();
            while(enumeration.hasMoreElements()) {
                BlackBerryContact contact = (BlackBerryContact)enumeration.nextElement();
                if(contact.getString(BlackBerryContact.UID, 0).equals(key)) {
                    return contact;
                }
            }
            return null;
        }
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

     * @throws DataAccessException
     */
    public void deleteRecord(Record record) throws DataAccessException {
        try {
            BlackBerryContactList list = (BlackBerryContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
            BlackBerryContact contact = getContact(record.getKey(), list, true);
            if(contact != null)
                list.removeContact(contact);
            list.close();
        }catch(Exception expn) {
            throw new DataAccessException(expn);
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

     * @throws DataAccessException
     **/
    public boolean getNextRecords(Vector v)
    throws DataAccessException {
        boolean      moreElements     = true;
        BlackBerryContact      contact          = null;
        Record       record           = null;
    
        try {

            for (int i=0; i<page; ++i) {
                moreElements = items.hasMoreElements();
                if (!moreElements) {
                    break;
                }

                contact = (BlackBerryContact)items.nextElement();

                record = new Record(contact.getString(contact.UID,0), RECORD_STATE_UNSIGNED, getContactString(pimList, contact));

                v.addElement(record);

            }

View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

       
        try {

            String contanctAsString = null;

            BlackBerryContact contact = getContact(uid, (BlackBerryContactList)pimList, true);

            contanctAsString = getContactString((BlackBerryContactList)pimList, contact);

            return contanctAsString;
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

     *
     * @param PIMItem Item that was removed from the address book
     */
    private void storeRecord(PIMItem item, char state)
    {
        BlackBerryContact contact = (BlackBerryContact)item;
        String uid = contact.getString(BlackBerryContact.UID, 0);
            
        try
        {
            contactDataStore.addRecord(uid, state, contact);
        }
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

     *
     * @param linkableContact
     *            The contact to be unlinked
     */
    private void unlinkContact(final LinkableContact linkableContact) {
        final BlackBerryContact contact =
                LinkedContactUtilities.getLinkedContact(linkableContact);
        if (contact != null) {
            LinkedContactUtilities.unlinkContact(contact, linkableContact
                    .getApplicationID());
        }
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

     * @param linkableContact
     *            The LinkableContact object to be linked
     */
    private static void linkContact(final LinkableContact linkableContact) {
        // Check if there is a linking candidate
        BlackBerryContact bbContact =
                LinkedContactUtilities.getContactLinkCandidate(linkableContact);

        // No linking candidate returned
        if (bbContact == null) {
            final String[] choices = { "Select Contact", "Create New" };
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

                            + e.toString());
            return null;
        }

        // Create a new BlackBerryContact
        BlackBerryContact contact =
                (BlackBerryContact) contacts.createContact();

        // Set the mobile phone number for the new BlackBerryContact
        final String mobileNumber =
                linkableContact.getString(LinkableContact.MOBILE_PHONE);
        if (mobileNumber != null) {
            contact.addString(Contact.TEL, Contact.ATTR_MOBILE, mobileNumber);
        }

        // Set the email address for the new BlackBerryContact
        final String emailAddress =
                linkableContact.getString(LinkableContact.EMAIL);
        if (emailAddress != null) {
            contact.addString(Contact.EMAIL, Contact.ATTR_PREFERRED,
                    linkableContact.getString(LinkableContact.EMAIL));
        }

        // Set the name for the new BlackBerryContact
        final String[] names =
                StringUtilities.stringToWords(linkableContact
                        .getString(LinkableContact.NAME));
        final String[] nameArray =
                new String[contacts.stringArraySize(Contact.NAME)];
        nameArray[Contact.NAME_FAMILY] = names[1];
        nameArray[Contact.NAME_GIVEN] = names[0];
        contact.addStringArray(Contact.NAME, PIMItem.ATTR_NONE, nameArray);

        // Invoke the Adress Book application
        final AddressBookArguments abArg =
                new AddressBookArguments(AddressBookArguments.ARG_NEW, contact);
        Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, abArg);

        try {
            // Commit changes to the contact model
            contact.commit();

            // Link the linkable contact with the new BlackBerry contact
            contact =
                    LinkedContactUtilities
                            .linkContact(contact, linkableContact);
View Full Code Here

Examples of net.rim.blackberry.api.pdap.BlackBerryContact

     * @param screenType
     *            One of {@link PhoneScreen#ACTIVECALL},
     *            {@link PhoneScreen#INCOMING} or {@link PhoneScreen#OUTGOING}
     */
    private static void sendData(final int callID, final int screenType) {
        BlackBerryContact contact = null;

        final PhoneCall phoneCall = Phone.getCall(callID);
        if (phoneCall != null) {
            // Try to obtain BlackBerryContact associated with the call
            contact = phoneCall.getContact();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.