BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-09-2009, 12:58 AM   #1 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default BlackBerry addressbook: can the contact be returned to my Application?

Please Login to Remove!

Dear Sir/Ma'am,

I am passing "APP_TYPE_ADDRESSBOOK" to open the addressbook from my application using Invoke API.
If I select a contact from the address-book and want it to be returned to my application, is that possible?

I want to select the contact and send to the server through an XML.

PROBLEM:

I create my own check-Box list which shows all the contacts from the address book. Then all I had to do was to select the contact and send them to the server. Problem came when the client told that it is taking too much time to open the customized address book list with 1000 contacts.

When I tried to open the same with the Invoke, it did open within a second, on the PEARL device.

Can I now interact the BlackBerry contact book with my application - (though it is returning only one contact at a time and there is no method to select multiple contacts at the same time)?

regards
__________________
having new s for developers!!!

Last edited by abhsax1978@hotmail.com : 05-09-2009 at 01:04 AM.
Offline  
Old 05-09-2009, 04:35 AM   #2 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default Solution for the above

PHP Code:
try {

                        
BlackBerryContactList ct_lst = (BlackBerryContactListPIM.getInstance().openPIMList(PIM.CONTACT_LISTPIM.READ_ONLY);
                        
PIMItem item null;
                        
item ct_lst.choose();
                        
parseFields(item);
            } catch (
PIMException ex) {
                        
ex.printStackTrace();
                   
 }
                }
private 
void parseFields(Object obj) {
        
Stringxxx91;xxx93; names null;
        
String FName nullLName null;
        
String EMail null;

        
String mobile null;

        
String workPh null;
        
intxxx91;xxx93; fields null;
        
Contact objCont null;
        
/////////////////////////////////
        
if (obj instanceof Contact) {
            
objCont = (Contactobj;
            
fields objCont.getFields();

            for (
int y 0objCont.countValues(Contact.TEL); y++) {
                if (
objCont.getAttributes(objCont.TELy) == Contact.ATTR_MOBILE) {
                    
mobile objCont.getString(Contact.TELy);
                } else if (
objCont.getAttributes(objCont.TELy) == Contact.ATTR_WORK) {
                    
workPh objCont.getString(Contact.TELy);
                }
            }
//                    ////////////////////////////////////////////////////////////

            
int index 0;

            while (
index fields.length) {
                switch (
fieldsxxx91;indexxxx93;) {

                    case 
Contact.EMAIL:
                        
EMail objCont.getString(fieldsxxx91;indexxxx93;, 0);
                        break;
                    case 
Contact.NAME:
                        
names objCont.getStringArray(fieldsxxx91;indexxxx93;, 0);
                        
FName namesxxx91;Contact.NAME_GIVENxxx93;;

                        
LName namesxxx91;Contact.NAME_FAMILYxxx93;;
                        if (
LName == null) {
                            
LName null;
                        }
                        
LogPrinter.logSpecificEvent("Contact returned:" FName " " LName);
                        break;
                }
                
index++;
            }
        }
    } 
__________________
having new s for developers!!!

Last edited by abhsax1978@hotmail.com : 05-09-2009 at 04:37 AM.
Offline  
Old 06-12-2009, 08:05 AM   #3 (permalink)
New Member
 
Join Date: Jun 2009
Model: 8700
PIN: N/A
Carrier: developer
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem to getting address

Hi ,
I have tried to access contacts from Blackberry addressbook but i am able to get address of that.
means i am not unable to get ATTR_HOME and ATTR_WORK address.
can anybody help me out for this.

Thanks in advance....
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





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