BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-29-2005, 07:26 PM   #1 (permalink)
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Addressbook Integration In My Software: Which Method Is Easiest/Fastest?

Please Login to Remove!

Hi,

I'm trying to figure out how to properly integrate an addressbook into my software.

Essentially, I need a BlackBerry application (that I'm writing) to be able to access the BlackBerry addressbook to retrieve a phone number. I've got the following preferences. I want to try to avoid reinventing the wheel and avoid designing my own addressbook GUI, and use the minimum amount of API calls: (The K.I.S.S. approach)

(1) I'd like to be able to just add a menu option to the existing BlackBerry Addressbook, so that the user can just click thumbwheel and launch my application on the selected phonebook entry.

(2) Alternatively, If that is not easy to do, I'd like to be able to launch the BlackBerry Addressbook as an address picker.

(3) Alternatively, if that's not possible, what is the fastest way to iterate through the whole addressbook to present the user a listing, in order to quickly pick an entry.

For entries with multiple phone numbers, I'd like to be able to pick which phone number I'd like. There seems to be multiple methods (all of which requires the signed API, which I have access to), but I would like to choose the easiest and fastest method.

This is for a speciallized application mainly for internal use and doesn't compete with any known product on this forum, so all you commercial developers (including PocketDay), please feel free to chime in. Thanks!
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 06-30-2005, 08:00 AM   #2 (permalink)
crs
BlackBerry Extraordinaire
 
Join Date: Oct 2004
Model: 8800
Carrier: cingular
Posts: 1,034
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mark,

Here's the deal (i've done this extensively). You can easily add a menu option to the bb address book and have your code invoked. You app should be a system app that's launched automatically at system boot time so the BB knows to add your menu item to the address book. You will be handed then contact record when your code is invoked (I've not specifically done this, but the docs say it).

You'll have to pick up each phone number and present the user with a simple dialog to select the one you want. PocketDay does this with the Speed Dial functionality.

You will definetely need the signed APIs to do any of this.

Have fun and if you need any other help, just yell.

Regards,

Mark
Offline  
Old 06-30-2005, 08:33 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Option #1 is the easiest approach.

As tirsch states, you will want to make it a "system module". In addition, it should "auto-run on startup". This is in the project properties.

Get the phone #s for a contact is a little nutty. It involves doing a countValues() to get the quantity of phone #s and then iterating throught the loop.

Holler if you hit a snag.
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 06-30-2005, 09:09 AM   #4 (permalink)
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the tips. It looks like it is the easiest method.

I'll now have to research for code samples illustrating how to make it a system module...
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 06-30-2005, 07:04 PM   #5 (permalink)
Thumbs Must Hurt
 
philbogle's Avatar
 
Join Date: Mar 2005
Location: Seattle, WA
Model: 8700g
Carrier: T-mobile
Posts: 196
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

When your custom menu item is invoked, how do you determine which name, address, and phone number is selected?

If I could do this, I could integrate with Berry 411 functionality like displaying a map of the address or doing a reverse lookup based on the phone number?
Offline  
Old 07-01-2005, 06:15 AM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Sep 2004
Model: 8700r
Carrier: Rogers
Posts: 221
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

RIM has actually switched to using the PIM of J2ME ( their custom PIM is deprecated ).

http://jcp.org/aboutJava/communitypr...075/index.html

Its a little bit tricky but if you google J2ME PIM there should be a lot of examples of how to access certain fields.
Offline  
Old 07-01-2005, 08:22 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

>> When your custom menu item is invoked, how do you determine which
>> name, address, and phone number is selected?

The selected/displayed contact is passed to the run() method of your specified class. There are examples of this in the Dev Guide. Look for "ApplicationMenuItem".
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 07-05-2005, 02:51 PM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: May 2005
Model: 8100
Carrier: T-Mobile
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by philbogle
When your custom menu item is invoked, how do you determine which name, address, and phone number is selected?

If I could do this, I could integrate with Berry 411 functionality like displaying a map of the address or doing a reverse lookup based on the phone number?

philbogle,

I think “custom menu” method will help me with making my BT printer driver more useful. If I could capture say Contacts, Calendar, or Task info then I could potentially send it out to a Bluetooth printer. Of course I’ll need to still figure out how to implement custom menus.

Nice idea… thanks indirectly I guess since your post was originally directed to Mark.
Offline  
Old 07-05-2005, 03:34 PM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2005
Model: 7520
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

[Aside...I just wanted to say guys that all this BB banter looks all exciting Tho I don't think I understand less than half of what's been written so far. I hope to soon tho.]...
Offline  
Old 07-05-2005, 05:05 PM   #10 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Feb 2005
Model: 7280
Carrier: cingular, no wait, AT&T
Posts: 300
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

BTW, if you run into issues getting the values/info you want or need, you can always screen scrape, which I had to master to overcome a bug in the 3.7 APIs. I hope you like the instanceof keyword...
Offline  
Old 07-22-2005, 03:13 AM   #11 (permalink)
Thumbs Must Hurt
 
philbogle's Avatar
 
Join Date: Mar 2005
Location: Seattle, WA
Model: 8700g
Carrier: T-mobile
Posts: 196
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding contact menu items to 3.7 AND 4.0

I've correctly gotten an app that adds a menu item to the contact list and obtains the contact. Unfortunately the class used for the contact type is different between 3.7 and 4.0 (in the case of 4.0 it's a javax.microedition.pim class, and in the case of 3.7 it's one of the RIM PIM classes. The two are not interchangeable.)

How can I create a single executable that works in both cases? Can you give me an example of how the screen scraping you mentioned works?

Thanks,
-phil
Offline  
Old 11-02-2005, 04:50 AM   #12 (permalink)
mag
New Member
 
Join Date: Nov 2005
Model: 7290
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default net.rim.blackberry.api.pim / net.rim.blackberry.api.pdap

Quote:
Originally Posted by philbogle
I've correctly gotten an app that adds a menu item to the contact list and obtains the contact. Unfortunately the class used for the contact type is different between 3.7 and 4.0 (in the case of 4.0 it's a javax.microedition.pim class, and in the case of 3.7 it's one of the RIM PIM classes. The two are not interchangeable.)

How can I create a single executable that works in both cases? Can you give me an example of how the screen scraping you mentioned works?

Thanks,
-phil
Hi,

does anyone know an answer to the above quoted first question?

Thanks,
mag

Last edited by mag : 11-02-2005 at 05:03 AM.
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.