|
 |
|
Retired BBF Moderator
Posts: 4,831
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: 8310
Carrier: Rogers
|
Addressbook Integration In My Software: Which Method Is Easiest/Fastest? -
06-29-2005, 06:26 PM
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
Questions? New BlackBerry User?
|
|
|
|
|
CrackBerry Addict
Posts: 975
Join Date: Oct 2004
Model: 8800
Carrier: cingular
|

06-30-2005, 07:00 AM
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
|
|
|
|
|
Thumbs Must Hurt
Posts: 175
Join Date: Aug 2004
Location: Metro NYC
|

06-30-2005, 07:33 AM
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.
|
|
|
|
|
Retired BBF Moderator
Posts: 4,831
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: 8310
Carrier: Rogers
|

06-30-2005, 08:09 AM
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
Questions? New BlackBerry User?
|
|
|
|
|
Thumbs Must Hurt
Posts: 191
Join Date: Mar 2005
Location: Seattle, WA
Model: 8700g
Carrier: T-mobile
|

06-30-2005, 06:04 PM
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?
|
|
|
|
|
Talking BlackBerry Encyclopedia
Posts: 221
Join Date: Sep 2004
Model: 8700r
Carrier: Rogers
|

07-01-2005, 05:15 AM
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.
|
|
|
|
|
Thumbs Must Hurt
Posts: 175
Join Date: Aug 2004
Location: Metro NYC
|

07-01-2005, 07:22 AM
>> 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".
|
|
|
|
|
Thumbs Must Hurt
Posts: 93
Join Date: May 2005
Model: 8100
Carrier: T-Mobile
|

07-05-2005, 01:51 PM
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.
|
|
|
|
|
Knows Where the Search Button Is
Posts: 40
Join Date: Jun 2005
Model: 7520
|

07-05-2005, 02:34 PM
[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.]...
|
|
|
|
|
Talking BlackBerry Encyclopedia
Posts: 300
Join Date: Feb 2005
Model: 7280
Carrier: cingular, no wait, AT&T
|

07-05-2005, 04:05 PM
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...
|
|
|
|
|
Thumbs Must Hurt
Posts: 191
Join Date: Mar 2005
Location: Seattle, WA
Model: 8700g
Carrier: T-mobile
|
Adding contact menu items to 3.7 AND 4.0 -
07-22-2005, 02:13 AM
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
|
|
|
|
|
New Member
Posts: 1
Join Date: Nov 2005
Model: 7290
|
net.rim.blackberry.api.pim / net.rim.blackberry.api.pdap -
11-02-2005, 03:50 AM
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 04:03 AM.
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|