Search code examples
cordovaglobalizationblackberry-10sencha-touch-2.2

Phonegap 2.3.0 Globalization class not found on BB10 Webworks app


I am developing a Phonegap 2.3 app on BlackBerry 10 with WebWorks and Sencha Touch 2.2. When I try to call the getPreferredLanguage() method as per the docs:

navigator.globalization.getPreferredLanguage(
  function (language) {alert('language: ' + language.value + '\n');},
  function () {alert('Error getting language\n');}
);

I get the following error:

Error: Status=2 Message=Class Globalization cannot be found

The docs state that the Globalization class is supported on BlackBerry with OS5 and higher so why am I getting class not found errors?


Solution

  • In your config.xml file change

    from

    <feature name="Geolocation">
      <param name="android-package" value="org.apache.cordova.Globalization" />  
    </feature>
    

    to

    <feature name="Geolocation">
      <param name="android-package" value="org.apache.cordova.globalization.Globalization" />  
    </feature>