James' webOS Mind

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.

  1. Launch the app with the app ID com.whitepages.mobile
  2. 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.
  3. If successful, show a banner notification.
  4. 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):

  1. appid — The app to send data back to (aka your appid).
  2. appname — The name of your app.
  3. action — The action to call when relaunching your app.
  4. 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.

Filed under WhitePages API Cross App webOS

2 notes &

Needed: Beta Testers for my latest webOS app

For the past week, I have been teasing everyone about my latest creation. Together, myself and Greg Hrebek (Syntactix, creators of YouView and Pack N’ Track) have been hard at work.

Today, I get to introduce to you to the fruits of that labor: Mobile Florist

Mobile Florist for webOS

Beta Testers Needed

Since this app is an e-commerce based app, we are doing a private/public beta. That means that anyone can join the beta, but it will not go into the Palm Beta Feeds.

The app is ready for real purchases, but for now, it’s forced into debug mode. That means you an run through the order process (and use fake data) to place a “fake” order. We even have a test credit card number for you to use. You can use a real credit card, but you will not be charged and your order will not be delivered.

How To Join

If you want to join the beta, please email me at erupnu@gmail.com with the subject “I want to beta test Mobile Florist”.

What is Required

  1. Ability to install an IPK app from an email attachment
  2. Strong desire to play with new apps
  3. Motivation to provide as much feedback as possible
  4. Have time right now to do all the above (not “I’ll get to it next week”)

Spread the Word!

Help us spread the word by tweeting this:

I want to beta test Mobile Florist for webOS http://bit.ly/e4DLrQ

10 notes &

iOS Style Google Maps for webOS



In working on a new project, I had the need to map things. No problem, I’ve done that before. The problem, was that we webOS developer’s do not have a suite of tools for this, so I was on my own.

The app called for mapping these points, and allowing the user to tap on the pins. That showed a custom infoWindow that could then be tapped on to see the details.

I am not a huge fan of the standard Google Maps markers nor infoWindows. iOS has some very sexy looking ones, so I wanted to use that. There is also the issue of “speed” with webOS, so I figured they could all be knocked out at once.

I was right.

Read more …

4 notes &

GPS on Verizon Pre 2

I’m beginning my work on fully testing and debugging GPS on a Verizon Pre 2 now that I have one of those devices. First, initial results are promising. GPS seems to be running quite smoothly.

There are some reports of GPS failing. If you have issues, then please follow this handy guide.

  1. Turn off Google Location Services
    1. Go into the Location Services App from the app launcher
    2. Make sure “Auto Locate” is turned on.
    3. Bring down the  app menu from the top left.
    4. Under “Locate Me Using…”, make sure there is no checkmark for “Use Google Services”.
    5. If that has a checkmark, then tap it to turn it off.
  2. Turn off your device. Pull the battery. Wait 2 minutes. Put battery back in and boot it up again.
  3. Now step outside.
  4. Lookup at the sky. If there are heavy clouds or rain, go back inside and start at step 2 another time.
  5. Open Google Maps and wait. Give it about 3-5 minutes [important that you be patient]. If the blue dot shows, then GPS is working.

If you follow these steps and Google Maps does not show you the blue dot, then I want to hear from you. But do not go trying funky stuff to make it work, this is a structured test. Please post in the PreCentral.net forum thread dedicated to this discussion: http://forums.precentral.net/palm-pre-2/276014-verizon-pre-2-users-hows-gps.html

There are a couple pieces of information that are needed:

  • Are you a VZ Navigator subscriber?
  • Did you get GPS working on your Pre+/Pre-?
  • Is there mountains, tall buildings, or anything that obstructs your view of the sky?
  • Did you try anything to get GPS working? If so, what did you try?

For now, I will focus on getting stand alone GPS working for 99% of devices. Once I am sure that all scenarios have been explored/resolved, then I will work on accuracy. The two are separate issues and I want to approach this methodically.