Posts Tagged ‘mobile’
* Long Live PhoneGap for BlackBerry
Posted on July 30th, 2009 by Dave Johnson. Filed under phonegap.
There have been some new developments in the PhoneGap on BlackBerry breathing new life into the project! It all boils down to the fact that in RIM OS >= 4.6 there is a browser rendering option that you can set to make the browser render using the modern rendering engine rather than the archaic one from OS 4.2.
It look something like this:
_renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, 17000, true);
After much trial and error it was found that the BrowserContentManager did not support this rendering option (and RIM says it is completely unsupported / experimental anyhow) yet the Field returned from BrowserContent.getDisplayableContent() does support it!
Long story short it looks like PhoneGap on RIM OS >= 4.6 is going to work really well.
Next up is looking at the new features in OS 5.0.
* PhoneGap iPhone Approval
Posted on June 13th, 2009 by Dave Johnson. Filed under mobile, phonegap.
The guys over at Rhomobile posted about IPhone App Store rejection issues the other day - I can only assume due to the recent problems that some users of PhoneGap have been having. Rhomobile and PhoneGap are similar in that they are frameworks that enable developers to build native mobile apps in a language they are familiar with, Ruby and JavaScript respectively.
I think that they are pretty much spot on in terms of their interpretation of the App Store rule 3.2.2 that states:
An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Appleās Published APIs and built-in interpreter(s).
The two key points in this App Store rule are where it says an app “may not itself install or launch other executable code by any means” and this is exactly what users of PhoneGap are doing if their apps are downloading JavaScript over the network rather than including it in the application www folder. By downloading JavaScript over the network at runtime the application is downloading and running interpreted code that Apple has not control over during their app approval process.
So if any of you PhoneGap developers are worried about Apple rejecting your app just make sure that you don’t download any JavaScript at runtime and instead include it in the application. Having said that, also make sure that you apps don’t look like you just took a shit and emailed it to Apple
That is just my thoughts on the issue, whether or not that is the *real* reason that Apple is rejecting PhoneGap apps we may never know but that is certainly one reason that they would do it I think. It could just be because they feel like it…
* Where 2.0 Slides
Posted on June 7th, 2009 by Dave Johnson. Filed under Conference, mobile.
Here are my slides from my workshop at the recent O’Reilly Where 2.0 conference down in San Jose.
* Where 2.0 Workshop
Posted on May 17th, 2009 by Dave Johnson. Filed under Conference, mobile.
I am going to be running a workshop down at the O’Reilly Where 2.0 conference on Tuesday called Giving Your Mobile Apps a Sense of Place.
I am going to cover Geo related features and issues of IPhone 2.2.1, Android 1.5 (aka Cupcake), RIM OS 4.7, and, most importantly, PhoneGap. I will be sure to post the slides once I am done them as well as put all the sample projects up on my GitHub.
If you are in San Jose Monday night then you will probably find me in the bar, whether I am done my slides or not!
* 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.
* BlackBerry PhoneGap Progress Report
Posted on December 6th, 2008 by Dave Johnson. Filed under phonegap.

We had a PhoneGap sprint just over a week ago which was pretty successful for me and my BlackBerry ambitions as well as everyone else. Through that sprint and over the past week, despite some setbacks, I got the OS v4.5 installed on my phone and the simulator on my computer giving me access to a few new things but I was sad to find that a few other things were still sorely lacking that are pretty important for something like PhoneGap. Just so you know, OS v4.5 is the latest OS that will run on my Curve 8310 - 4.6 will run on the Bold, Pearl Flip and newer Curves while 4.7 works on the Storm. The two biggest gaffs by RIM are in the BlackBerry web browser for OS v4.5 where that the following rather important features are missing:
- You can’t pass function pointers to setTimeout.
- You can’t access DOM Nodes in any way shape or form (aside from form fields). So there is no getElementById or innerHTML on the resulting nodes. This make web application development a little bit difficult.
- There is no XMLHttpRequest object.
- While not really expected, there is no SQLite support
anywhere on the phone as of yet, let alone the browser.
Anyhow, despite those setbacks on the v4.5 OS I did get the communication between the BlackBerry device and the web page all dialed now. Not only that but I have implemented the W3C geolocation API and am going to follow that same pattern for the other APIs. Check out the geolocation JavaScript interface as well as the platform specific implementation.
In the actual BlackBerry code there is lots of boiler plate stuff. The main hurdle was figuring what the best (or any) way to embed the browser in the application was and enable communication between JavaScript in the browser and the BlackBerry Java code. In the end I pretty much had to take the route of implementing the browser myself through the BrowserContentManager. This means that I have to implement lots of functionality, but it also means that I am in control of cookies and responsible for accepting them from JavaScript in the web page through the implementation of the browser fields RenderingApplication.eventOccurred method when the event type is EVENT_SET_HTTP_COOKIE and returning them to JavaScript by implementing the RenderingApplication.GetHTTPCookie method.
When the set cookie event occurs I parse out the cookies looking for one named bb_command and expect it to contain some JSON object (that is parsed with the J2ME port of a Java JSON lib) with a command property (like for opening maps or getting the GPS location) and some arguments (like points to plot on the map or how long to vibrate for). The case statement just looks like this:
switch (command)
{
case 0:
this._getLocation = true;
this.startLocationUpdate();
break;
case 1:
Invoke.invokeApplication(
Invoke.APP_TYPE_MAPS,
new MapsArguments(MapsArguments.ARG_LOCATION_DOCUMENT,
getLocationDocument(args))
);
break;
case 2:
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,
new CameraArguments()
);
break;
case 3:
if (Alert.isVibrateSupported())
Alert.startVibrate(getVibrateDuration(args));
break;
case 4:
Invoke.invokeApplication(Invoke.APP_TYPE_PHONE,
new PhoneArguments(PhoneArguments.ARG_CALL,
getPhoneNumber(args)
)
);
break;
default:
}
where args is just a JSON string that the various methods like getPhoneNumber parse to get the args they want.
I will post some more specific code snippets like how to send text messages and so on very soon.
* Blackberry Storm Simulator/API Available
Posted on November 13th, 2008 by Dave Johnson. Filed under mobile, phonegap.
For those interested in Blackberry development the simulator is now Available from RIM.
In the summary of changes to the API there were a few things of note including new classes for the touch screen, virtual keyboard, orientation and rotation, and accelerometer. Oh and how could I forget that Storm owners will also have the ability to set the theme wallpaper!
The JavaDocs for the 4.7 API (the OS version of the Storm) can be found here for reference.
The one good thing is that it should not mean I will need to make any changes to the Blackberry version of PhoneGap! However, unluckily it means that Storm is still using the same shitty old browser and not WebKit.
Recent Posts
Archives
- 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
