Archive for January, 2009
* BlackBerry PhoneGap RIP
Posted on January 25th, 2009 by Dave Johnson. Filed under mobile, phonegap.
I was probably the only one working on PhoneGap for BlackBerry and now there might not be anyone. I have officially given up my BlackBerry programming endeavours for the time being in favour of greener pastures in the form of a Google Android G1. The final straw was when I found that the BrowserContentManager, which is the class one can use in their own BlackBerry application to render HTML content, does not support the same APIs as the actual web browser on the phone! In version 4.6 of the BlackBerry OS they introduced a proper, and fairly decent, web browser (that is definitely *not* WebKit as so many people like to say) and yet the BrowserContentManager is stuck back in the OS 4.2 days. Not sure if the Storm (OS 4.7) has changed that or not, although the API of the normal browser in 4.7 is identical to 4.6 so I assume not and somone on the BlackBerry support forums corroborates my findings.
I am working on my first Android application today and will hopefully get some PhoneGap work in there too.
* Vehicle Electrification Cost Effectiveness
Posted on January 19th, 2009 by Dave Johnson. Filed under Energy.
Over the past few days my wife and I have been living without propane - due to a miscommunication between myself and the company that is supposed to take care of keeping our large propane tank filled with said propane - and subsequently there has been no stove, hot water, or heat. It was pretty tumultuous until I found a few spare 20lb propane tanks that we have since connected to our system. In case you were wondering just cooking one small meal and keeping the house at 15 degrees Celsius drained the one tank in under 24 hours.
Primary Energy Consumption
This interruption in energy flow to my house got me thinking about how much energy from fossil fuels is used in the home and that compares to fuel used for transportation. I found the numbers a little surprising.
A quick Google revealed the following stats for primary energy consumption by sector from 1949 to 2007 (in trillion Btu) in the US care of the US Energy Information Administration (EIA).
| Residential | Commercial | Industrial | Transportation | Electricity |
| 6,688 | 3,898 | 21,435 | 29,012 | 40,567 |
Or in pictures it looks more like this:

Of course the transportation number includes trains, planes and automobiles (including trucks) so what we should really look at is residential automobile usage. Again from the EIA data but approximating 2008 fuel consumption at 133 billion gallons of gasoline we arrive at about 15,000 trillion Btu’s of primary energy for only residential automobile usage. Updating the chart above we can see that the residential + commercial sector and residential transportation sector are much closer in size now:

What is the end use of the primary energy for the residential sector? The lions share of that energy is going towards oil or gas furnaces and water heaters. It is a similar situation for the commercial sector. But of course the industrial sector has a number of different uses for fossil fuels.
Energy Usage
The first thing that I notice about those numbers is that the total primary energy use in residential and commercial sectors commercial is almost 66% of the total primary energy used for residential automobiles. So if instead of buying a fancy new electric or hybrid car for over $30,000 people were to purchase an electric hot water heater, stove, and / or furnace, it would be equivalent to replacing about 66% of the cars on the road with all electrics. That is with no corporate bail outs, no huge incentive programs for companies or tax payers and no huge technological barriers like building new types of batteries. The problem is that people never see your electric furnace and you don’t get that added value of it being a status symbol like a green car.
I imagine the numbers look pretty similar in Canada and maybe in Europe too where gas is much more common in the home and car usage is lower. However, the lifecycle efficiency of generating electricity centrally from fossil fuels is sligtly higher than burning the fossil fuel in the automobile due to the relative low efficiency of the internal combustion engine.
Reality
Of course there are still other considerations to make before converting to electric cars such as shortages of materials used in magnets for motors such as dysprosium and, maybe more importantly, most electric cars will be charged with electricty generated from fossil fuels for the forseable future. The exception there is of course Better Place.
Looking at those numbers from the EIA if the US were to convert all vehicles over to pure electric it would mean increasing the current electricity generation capacity by something like 38%. That is about the increase in electricity generation from 1989 to 2007.
So if you are really thinking of getting an electric car, or even a hybrid first think about getting an electric appliance instead or, even better, get a bicycle and get some exercise ![]()
* BlackBerry Browser Oddities
Posted on January 4th, 2009 by Dave Johnson. Filed under phonegap.
So for PhoneGap on BlackBerry I was using a BrowserContentManager to achieve the PhoneGap functionality. I finally got around to installing the BlackBerry Bold 9000 simulator (OS 4.6) with hopes that the BrowserContentManager would support nice things like Node.innerHTML and other things that one might like for making web apps.
Alas, I was terribly wrong. Here is what the BrowserContentManager content looks like:

And the native BlackBerry browser looks like this:

The main things to notice are:
- the font in the native browser is way nicer (anti-aliasing goes a long way I guess)
- the buttons are different
- there is no CSS being applied in the BrowserContentManager
- the BrowserContentManager does not appear to support the mouse pointer mode
Of course not visible is the very different JavaScript DOM API…
I am still investigating but so far I am not very impressed by the functionality of the BrowserContentManager. Is there a better way to achieve the PhoneGap functionality?
Recent Posts
- Mobile Geolocation Implementations
- PhoneGap Native Bridge
- PhoneGap and BlackBerry OS 6
- BlackBerry JavaScript Oddities
- JavaScript Event Merging
Archives
- August 2010
- July 2010
- June 2010
- April 2010
- March 2010
- February 2010
- January 2010
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
