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


Brand New STMicroelectronics M4T28-BR12SH1 TIMEKEEPER SNAPHAT Battery picture

Brand New STMicroelectronics M4T28-BR12SH1 TIMEKEEPER SNAPHAT Battery

$16.49



Fuji IGTB Unit 7MBP100RA120-06 picture

Fuji IGTB Unit 7MBP100RA120-06

$39.95



Fuji IGTB Unit A50L-0001-0327 picture

Fuji IGTB Unit A50L-0001-0327

$29.95



PM50CLS120 MITSUBISHI ELECTRIC IGBT-MODUL ID191791 Spot Goods Ups Express #CG picture

PM50CLS120 MITSUBISHI ELECTRIC IGBT-MODUL ID191791 Spot Goods Ups Express #CG

$313.40



MOSFET - IRFZ44N 55V - Transistor  for Arduino Pi  TTL picture

MOSFET - IRFZ44N 55V - Transistor for Arduino Pi TTL

$54.79



TO-92 Assortment NPN PNP DIY kit 15 value 600pcs Transistor  picture

TO-92 Assortment NPN PNP DIY kit 15 value 600pcs Transistor

$14.40







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