Package javax.microedition.pim

Examples of javax.microedition.pim.ContactList


            int nameArraySize;
            int addressArraySize;
            // open the handheld contacts database
            // receive nameArraySize and addressArraySize

            ContactList contactList;
            if( _serviceName.length() == 0 ) {
                contactList = (ContactList) BlackBerryPIM.getInstance().openPIMList( PIM.CONTACT_LIST, PIM.READ_WRITE );
            } else {
                contactList = (ContactList) BlackBerryPIM.getInstance().openPIMList( PIM.CONTACT_LIST, PIM.READ_WRITE,
                        _serviceName );
            }
            nameArraySize = contactList.stringArraySize( Contact.NAME );
            addressArraySize = contactList.stringArraySize( Contact.ADDR );

            if( _contact == null ) {
                _contact = (Contact) contactList.createContact();
            }

            // name & title
            String[] name = new String[ nameArraySize ];
            name[ Contact.NAME_GIVEN ] = _outer.getItem( ContactObject.FIELD_FIRSTNAME ).getStringValue();
View Full Code Here


            if( _contact == null ) {
                throw new PIMException( "PIMItem not found." );
            }

            // open the handheld contacts database for removing
            ContactList contactList;
            if( _serviceName.length() == 0 ) {
                contactList = (ContactList) BlackBerryPIM.getInstance().openPIMList( PIM.CONTACT_LIST, PIM.WRITE_ONLY );
            } else {
                contactList = (ContactList) BlackBerryPIM.getInstance().openPIMList( PIM.CONTACT_LIST, PIM.WRITE_ONLY,
                        _serviceName );
            }

            contactList.removeContact( _contact );
            _contact = null;

            return UNDEFINED;
        }
View Full Code Here

                isAscending = b.booleanValue();
            }
        }

        boolean isSorted = orderByField != null && orderByField.length() > 0 ? true : false;
        ContactList contactList;
        try {
            if( serviceName.length() == 0 ) {
                contactList = (ContactList) PIM.getInstance().openPIMList( PIM.CONTACT_LIST, PIM.READ_WRITE );
            } else {
                contactList = (ContactList) PIM.getInstance().openPIMList( PIM.CONTACT_LIST, PIM.READ_WRITE, serviceName );
            }
        } catch( PIMException pime ) {
            return contactsFound;
        }

        Vector found = new Vector();
        Enumeration e;
        int iElement = 0;
        try {
            e = contactList.items();
            while( e.hasMoreElements() ) {
                if( !isSorted && iElement == maxReturn ) {
                    break;
                }
View Full Code Here

                        if( locality.length() > 0 && region.length() > 0 ) {
                            Contact c;

                            // Create a new contact
                            try {
                                final ContactList contactList = (ContactList) PIM.getInstance().openPIMList( PIM.CONTACT_LIST,
                                        PIM.READ_WRITE );
                                c = contactList.createContact();
                            } catch( final PIMException e ) {
                                throw e;
                            }

                            final String[] addressHome = new String[ 7 ];
View Full Code Here

            return false;
        } else {
            // Save the contact.
            try {
                final ContactList contactList =
                        (ContactList) PIM.getInstance().openPIMList(
                                PIM.CONTACT_LIST, PIM.WRITE_ONLY);
                final Contact contact = contactList.createContact();
                final String[] name =
                        new String[contactList.stringArraySize(Contact.NAME)];

                /*
                 * This section adds values to selective PIM items. Additional
                 * items can be added for Contact or BlackBerryContact fields.
                 * Please refer to javadocs.
View Full Code Here

                // Create a list of Contacts from the address book and search
                // list
                // for first occurrence of a valid address.
                try {
                    // Create list of Contacts
                    final ContactList contactList =
                            (ContactList) PIM.getInstance().openPIMList(
                                    PIM.CONTACT_LIST, PIM.READ_WRITE);
                    final Enumeration enumContact = contactList.items();

                    // Search for a valid address
                    while (enumContact.hasMoreElements() && !foundAddress) {
                        c = (Contact) enumContact.nextElement();
View Full Code Here

TOP

Related Classes of javax.microedition.pim.ContactList

Copyright © 2018 www.massapicom. 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.