RIM Blackberry Javascript, Whats the deal ?
Published January 10, 2011 by Richard Uren

By Tim Lee @ Flickr
All modern versions of RIM OS support javascript however in some cases older versions of RIM OS have javascript disabled.
According to the good folks over at blackberry support forums, Javascript was disabled by default on RIM OS versions 4.0 to 4.5, enabled by default for Wifi only on OS 4.6 to 4.7 and enabled by default on OS 5.0 and above.
RIM OS 5 was released late October 2009.
http://supportforums.blackberry.com/t5/Web-Development/Default-BlackBerry-Browser-configuration-options/ta-p/445729
http://supportforums.blackberry.com/t5/Web-Development/Javascript-and-blackberry-web-development-I-heard-its-not-a-good/m-p/633492
http://en.wikipedia.org/wiki/BlackBerry_OS
One interesting point of note is : “While RIM develops and releases updated versions of its operating system to support each device, it is up to the individual carriers to decide if and when a version is released to its users. On April 2010 RIM announced the new BlackBerry OS 6.0 version, which will be released in the 3rd quarter 2010″.
So, its up to your carrier when new versions hit your handset.
Related posts:
- iPad Detection and Redirection
- Mobile Detection with the Zend framework.
- Firefox User-Agent-Switcher – Excellent for mobile website testing!
Posted In Mobile Web | 0 Comments
iPad Detection and Redirection
Published July 28, 2010 by Richard Uren
We’ve had a few emails over the last week or from folks wanting to detect iPads and/or redirect iPads to iPad specific sites. Its super easy and takes a few minutes to set up. Here’s the scoop :
- Login, browse over to Sites and click Add Site Profile.
- Enter the Site Name and the Website Address (see below)
- Check ‘Smart Redirection’ (This allows people to jump backwards and forwards between your iPad and normal websites without being redirected).
- Click Add New Rule to add a new redirection rule for iPad devices
- Give the Rule a name like ‘Redirect iPads’
- Add a condition – In this case its a match for the Model
- Enter the URL that iPads should be redirected to
Job Done.
Happy iPad Redirecting.

Related posts:
- Mobile Detection with the Zend framework.
- Firefox User-Agent-Switcher – Excellent for mobile website testing!
Posted In Mobile Web | 0 Comments
Mobile Detection with the Zend framework.
Published February 16, 2010 by Richard
Today’s quick tutorial is from Peter Johnson. Thanks Peter, take it away.
—–
Getting up and running with Handset Detection under Zend Framework is Quick & Easy.
To start performing detections you’ll need to download the latest PHP API kit from http://www.handsetdetection.com/resources/api-kits
Extract the whole hdapi folder into your Zend library folder, mine is /application/library, it should be named /application/library/hdapi
Copy your hdconfig.ini file from the kit into your public folder, mine is /public, it should be named /public/hdconfig.ini
Now you should be able to start using the API directly, but to simpify the process even further you can use this wrapper class.
Create a file called ‘HandsetDetectionService.php’ in your Zend library folder, mine is /application/library, it should be named /application/library/HandsetDetectionService.php
< ?php class HandsetDetectionService { private $_instance; private $_caching = true; private $_hdapi_path; public function __construct() { $this->_importHdApi();
$this->_instance = new HandsetDetection();
$this->_instance->setTimeout( 10 );
$this->_instance->detectInit();
}
public function isMobile()
{
if( !$_caching ){ $this->_instance->clearCache(); }
return $this->_instance->ismobile();
}
public function mobileRedirect( $url = "http://m.google.com" )
{
$this->_instance->setMobileSite( $url );
if( $this->isMobile() ) $this->_instance->redirectToMobileSite();
}
public function detect()
{
if( !$_caching ){ $this->_instance->clearCache(); }
$this->_instance->detect();
return $this->_instance->getDetect();
}
public function vendorList()
{
if( !$_caching ){ $this->_instance->clearCache(); }
$this->_instance->vendor();
return $this->_instance->getVendor();
}
public function modelList( $vendor_name )
{
if( !$_caching ){ $this->_instance->clearCache(); }
$this->_instance->model( $vendor_name );
return $this->_instance->getModel();
}
public function getError()
{
$error = $this->_instance->getError();
return ( $error == 'Not Found' ? '' : $error );
}
private function _importHdApi()
{
$this->_hdapi_path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'library' .
DIRECTORY_SEPARATOR . 'hdapi' . DIRECTORY_SEPARATOR;
require_once( $this->_hdapi_path . 'class.wsse.php' );
if (!function_exists('json_encode')) require_once( $this->_hdapi_path . 'json.php');
require_once( $this->_hdapi_path . 'hdbase.php' );
}
}
?>
Now you can use this code in any controller to test out the API:
< ?php // Setup Connection $hd = new HandsetDetectionService(); // Perform a Basic Detect, Just to see if it's a Mobile Handset $ismobile = $hd->isMobile();
$error = $hd->getError();
// Output Some Data
if( $error ) echo "An Error Occured: $error";
elseif ( $ismobile )
{
// Do a Full Detection, Only needed if you want the Device details
// ..such as Model Name or Handset Capabilities.
if( $ismobile ) $detection = $hd->detect();
echo "It's a Mobile Handset! - " . @$detection['product_info']['brand_name'] . " " . @$detection['product_info']['model_name'];
echo ""; print_r( $detection ); echo "";
}
else echo "Not a Mobile Handset.";
// Query for a list of Vendors & Models
if( !$error )
{
echo "Vendor List";
echo ""; print_r( $hd->vendorList() ); echo "";
echo "Models from 'Apple'";
echo ""; print_r( $hd->modelList('Apple') ); echo "";
}
?>
or, if you just want to do a basic Mobile Redirect, use this:
< ?php $hd = new HandsetDetectionService(); $hd->mobileRedirect( 'http://m.digg.com' ); ?>
Note: If Zend is having trouble loading the HandsetDetectionService class, you probably have Autoloading disabled and you’ll need to include that file manually, to do this add the following before you call ‘new HandsetDetectionService()’:
require_once( $this->_hdapi_path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'HandsetDetectionService.php' );
Related posts:
Posted In Mobile Web | 1 Comment
Firefox User-Agent-Switcher – Excellent for mobile website testing!
Published April 5, 2009 by Richard Uren
Last week I discovered an excellent tool for mobile website testing. Its the Firefox User-Agent-Switcher extension by Chris Pederick. Its so simple to use.
- Install the Firefox extension.
- Browse over to the Handset Detection device list, select a device (eg Nokia N95) and copy one of the user-agents.
- From the Firefox menu, Select Tools >> User Agent Switcher >> Options >> Options
- Click User Agents the Click Add
- In description put ‘Nokia N95′ and paste your user-agent into the user agent field.
Now all you need to do, for Firefox to mimic a Nokia N95, is select Tools >> User Agent Switcher >> Nokia N95. Viola ! Your website will now think you’re browsing from a Nokia N95.
Posted In Mobile Web | 3 Comments