18 notes &
Integrating with WhitePages on webOS
WhitePages.com has announced today that they are again leading the pack in mobile development by launching their app for webOS. While reaching parity with their offerings on other platforms, WhitePages for webOS has a few extra bonus features that no other platform can offer. I’ve worked hard with WhitePages to help bring these features, and we are extremely excited.
First up is the patch. Being a leader, WhitePages is fully embracing Homebrew. To that end, we have released a patch for the Phone Call Log. This allows you to lookup any phone number from your call log with 1 tap.
The WhitePages app sports the ability for any app to launch it, as well as populate and perform searches for People, Business’, and Reverse Phone Lookups.
Further innovating on the cross-app capabilities unique to webOS, WhitePages can actually communicate with your app and share contact data. From a developer standpoint, it behaves a lot like a people picker, but with 200+ million adults it can pull from. That’s some serious horse power.
The WhitePages Patch
The patch for the WhitePages app is simple. It modifies your call log to add an option that allows you to lookup any number with 1 tap. It’s simple, elegant, and unbelievably useful (see screenshot below).
Not sure how to get the patch? You need Preware. Need Preware? Then go right now and get “Preware Homebrew Documentation” from the app catalog. It will give you everything you need to start your Homebrew journey.

Cross App Launch & Searching
In WhitePages, you can launch the app and populate the data for a user for any search in the app. It’s really easy, just use the application manager to launch the app with a few params:
this.controller.serviceRequest("palm://com.palm.applicationManager", {
method: 'launch',
parameters: {
id: "com.whitepages.mobile",
params: {action: "search", scene: "people", search_firstname: "James", search_lastname: "Harris", search_location: "Pensacola, FL", autosearch: true}
},
onSuccess:function(){
//--> Nothing, it was a success!
Mojo.Controller.getAppController().showBanner($L("Launching WhitePages"), {source: 'notification'});
}.bind(this),
onFailure:function(){
this.controller.showAlertDialog({
onChoose: function(value){
if (value=="open"){
this.controller.serviceRequest('palm://com.palm.applicationManager', {
method:'open',
parameters:{
target: "http://developer.palm.com/appredirect/?packageid=com.whitepages.mobile"
}
});
}
},
preventCancel: false,
title: $L("WhitePages App Not Installed"),
message: $L("Sorry! WhitePages is not installed on your device. You can download this app from the App Catalog (Free) to open up more features and time saving people lookups."),
choices:[
{label:$L('Nevermind'), value:"ok", type:'dismissal'},
{label:$L('Open in App Catalog'), value:"open", type:'affirmative'}
]
});
}.bind(this)
});
If we break this down, it’s simple.
- Launch the app with the app ID com.whitepages.mobile
- Pass along the params specified. In this case, we are going to do a people search for the First Name “James”, Last Name “Harris”, in “Pensacola, FL”. The autosearch is a true/false option to start the search automatically.
- If successful, show a banner notification.
- If failure, alert user that WhitePages is not installed and offer ability to download it (it’s free!)
That’s it. WhitePages also has a Reverse Lookup and Business Search. These are available as well. Simply change the params.
Business Name Search:
{action: “search”, scene: “business”, search_type: “N”, search_name: “BUSINESS NAME”, search_location: “CITY, STATE —or— ZIP CODE”, autosearch: true/false}
Business Category Search:
{action: “search”, scene: “business”, search_type: ”C”, search_name: “BUSINESS CATEGORY”, search_location: “CITY, STATE —or— ZIP CODE”, autosearch: true/false}
Reverse Phone Lookup:
{action: “search”, scene: “reverse”, search_number: ”(NNN) NNN-NNNN”, autosearch: true/false}
Tip: Leave the search_location field blank/null and it will automatically fill in the users location from GPS.
How can you use this?
If your app ever has the need for people to find other people or business’, then this is the right tool for you. Any app that deals with phone numbers can quickly let users find out who it actually belongs to.
Take YouView Visual Voicemail for example. You might have an unknown number calling you, but get a garbled or no voicemail at all. Using the WhitePages integration, you can quickly find out who it is that called.
Does your app help people find coffee places, Bank locations, or any kind of business? Use the business search options to make this quick and easy.
Sharing Data, aka 200 Million+ People Picker
Think of this feature like a people picker, but with 200 million+ names and address’ at it’s disposal. The user finds the specific contact they need, then hit the “Send to YOURAPPNAME”, and that data is automatically sent along as a 2.0 formatted contact record.
To take advantage of this, we simply need to launch WhitePages and send along a few pieces of information.
this.controller.serviceRequest("palm://com.palm.applicationManager", {
method: 'launch',
parameters: {
id: "com.whitepages.mobile",
params: {sendToApp: {appid: Mojo.Controller.appInfo.id, appname: Mojo.Controller.appInfo.title, action:"selectfromwhitepages", closeapp:false}}
},
onSuccess:function(){
//--> Nothing, it was a success!
Mojo.Controller.getAppController().showBanner($L("Launching WhitePages"), {source: 'notification'});
}.bind(this),
onFailure:function(){
//Mojo.Log.error("WP: Send To App -- Error launching the app.");
this.controller.showAlertDialog({
onChoose: function(value){
if (value=="open"){
this.controller.serviceRequest('palm://com.palm.applicationManager', {
method:'open',
parameters:{
target: "http://developer.palm.com/appredirect/?packageid=com.whitepages.mobile"
}
});
}
},
preventCancel: false,
title: $L("WhitePages App Not Installed"),
message: $L("Sorry! WhitePages is not installed on your device. You can download this app from the App Catalog (Free) to open up more features and time saving people lookups."),
choices:[
{label:$L('Nevermind'), value:"ok", type:'dismissal'},
{label:$L('Open in App Catalog'), value:"open", type:'affirmative'}
]
});
}.bind(this)
});
In this case, we are launching WhitePages, but sending along data in a sendToApp parameter. This hold’s 3 vital pieces of information (and 1 more for flexibility):
- appid — The app to send data back to (aka your appid).
- appname — The name of your app.
- action — The action to call when relaunching your app.
- closeapp — Allows you to determine if the WhitePages app should close once a contact is “sent” back to your app.
You can add any parameters you need outside of the ‘sendToApp’ option, and those will be echoed along when your app is called.
When a use finds a contact, they will be presented with a button that says “Send to MYAPPNAME”. MYAPPNAME is the name of your app sent along in the launch request params.
When the user taps on this, your app is then launched and the contact data is sent through the params.response property as a webOS 2.0 formatted contact record.
You then listen for the relaunch and params, then do with it as you need.
How can you use this?
If you ever have the need to get contact data, then this is your tool. The full contact information is sent over so you can do with it as you need.
Take Mobile Florist for example. When checking out, you may want to send flowers to your significant others work address. If you are like me, you do not have it memorized. Utilizing the Business (and people) Search, Mobile Florist let’s you quickly and effortlessly find, select, and auto fill that address data. No copy/paste or typing required. It goes above the multi-tasking concept and automates this process.




Sample Code & Discussion
As always, I like to whip up little samples for you to play with. Want to see a working example of how this is all done? Then download the WhitePages sample app.
Need help integrating with WhitePages? Hit me up on Twitter @PalmFlashCards, or post in the Palm Developer Forum thread dedicated to this app.

