Phonegap 1.0.0 Released: Update your plugins

Phonegap 1.0.0 was released today. It’s a good update with a lot of improvements, and it’s finally out of prerelease stage.

However, I had some problems with the ChildBrowser plugin not being recognized on iOS. I kept getting this error message, even though I had ChildBrowserCommand defined in PhoneGap.plist:

ERROR: Plugin 'ChildBrowserCommand' not found, or is not a PGPlugin. Check your plugin mapping in PhoneGap.plist.

After looking at it for quite a while, I found the problem in PhoneGapDelegate.m


// first, we try to find the pluginName in the pluginsMap
// (acts as a whitelist as well) if it does not exist, we return nil
// NOTE: plugin names are matched as lowercase to avoid problems - however, a
// possible issue is there can be duplicates possible if you had:
// "com.phonegap.Foo" and "com.phonegap.foo" - only the lower-cased entry will match
NSString* className = [self.pluginsMap objectForKey:[pluginName lowercaseString]];

Phonegap now requires the plugin identifiers in PhoneGap.plist to be in lowercase, so instead of
“ChildBrowserCommand” as the key, you need to change that to “childbrowsercommand” and it will start working again. Also make sure your plugin is up to date as they’ve made some changes in the last week or two.

I hope this helps anybody who ran into this message, and it was pretty frustrating for me on a Friday afternoon.


Mobile Webapp Development in Chrome

View this post without wordpress.com restrictions

What do Safari, Chrome, iPhone, and Android all have in common? They use Webkit as their html rendering engine. This has a bunch of nice side effects for mobile developers, the nicest of which is you can do at least 80% of your mobile web development on the desktop if you use Chrome or Safari.  Since I’m on linux, I use Chrome, and it’s awesome that all the mobile libraries (like Sencha Touch, jqTouch, etc).

I wrote a proof of concept Sencha Touch app that works almost exactly the same in Chrome as it does on my Nexus 1.  However one of the things that bugs me is that the browsers don’t honor the META viewport directives, and I seem to always get weird scrollbars showing up and ruining everything.  so I wrote a little scriptlet that will pop up a window with the current page in 320×480 and without scrollbars.

Usually to install a bookmarklet, you just drag a link from a page to your bookmark bar, but wordpress.com doesn’t allow me to put javascript on a page (or iframes). So you can either view this post as it was meant to be viewed or you can manually add a bookmark with the following javascript as its destination:

javascript:var w=window.open(location.href,null,'toolbar=0,status=0,location=0,menubar=0,width=320,height=480,scrollbars=0');w.onload=function(){w.document.body.style['overflow-x']='hidden';w.document.body.style['overflow-y']='hidden';};


Installing Ubuntu 9.04

I’ve been running Ubuntu 8.04 since may of last year and have been extremely satisfied. I skipped 8.10, and now I’ve started to notice some of my software getting old, and since I never want to mess with backports again, I’ve been looking forward to the new “Jaunty Jackalope” release (I think the names are terrible). In short, it worked great.

It took less than 15 minutes from the time I inserted the CD to when it presented me with a GRUB menu. I pretty much clicked through all the menus as defaults, except I changed it to install over to instead of next to my 8.04 install. It used ext3, and I didn’t see an ext4 option anywhere, which would have been nice. This time it even noticed my Windows drive and put a “Vista” menu item at the bottom of GRUB that worked perfectly the first time, without me having to remember a bunch of menu.lst hide/map commands.

First thoughts: They were right about the boot time, it is substantially faster to get me to a login prompt. The default desktop wallpaper is ugly, but it detected my 1920×1200 display perfectly. There were only 11 updates I needed to install at first, which is pretty good but will certainly get much worse as time goes by.

Wow feature: After I installed the new updates, a window popped up asking me to configure my printer. Not only had it heard of the Canon Pixma iP3000, it had it preselected. I clicked “next, next, print a test page” and after 30 seconds of the printer adjusting itself the test page shot right out. That’s pretty amazing. However in the settings dialog that followed it told me that while the printer was “shared” it wasn’t “published” and I’d have to go see the “server settings” to change that, wherever those are.

The fancy compiz desktop effects aren’t enabled by default, but when I chose to enable them it told me I have a nvidia card and then installed the drivers for me. Restart (login/logout) and its up and running and I have my cube back.

MP3 files played after a couple clicks to a dialog about restricted packages. I understand the dialog but that doesn’t make it less annoying.

Overall, the install was incredibly painless and I was up and running with the defaults in no time. I didn’t have to type on a command line at all and everthing just worked out of the box. Pretty impressive.


Follow

Get every new post delivered to your Inbox.