BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-09-2009, 12:58 AM   #1
abhsax1978@hotmail.com
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
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
abhsax1978@hotmail.com
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
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
rishabh1986
New Member
 
Join Date: Jun 2009
Model: 8700
PIN: N/A
Carrier: developer
Posts: 14
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



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


BlackBerry Pearl 8100 Retail Display Unit - Pale Gold - Fake play movie Prop D3 picture

BlackBerry Pearl 8100 Retail Display Unit - Pale Gold - Fake play movie Prop D3

$12.99



Vintage RIM Blackberry R957M-2-5 with Belt Clip picture

Vintage RIM Blackberry R957M-2-5 with Belt Clip

$17.99



Little Trees 67343 Blackberry Clove Hanging Air Freshener for Car/Home 6 Pack picture

Little Trees 67343 Blackberry Clove Hanging Air Freshener for Car/Home 6 Pack

$8.99



Brand New Miyoo Mini PLUS LCD replacement Screen, FOR Miyoo PLUS, LCD Display picture

Brand New Miyoo Mini PLUS LCD replacement Screen, FOR Miyoo PLUS, LCD Display

$18.80



Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh picture

Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh

$179.95



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19







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