We are trying to develop a phonegap app with GWT, phonegap 2.4, gwtphonegap 2.4. Now we are testing it against Android 4.2. We have used the geopositioning stuff and it works like a charm in browser and mobile, but when we try to use the Globalization for taking the system's locale it doesn't work. The onPhneGapAvailable event never fires and if we call getGlobalization directly it says it is undefined.
We call this method from a onPhoneGapAvailable event:
private void detectLanguage() {
//if it is in a mobile take the language from the OS
if (phoneGap.isPhoneGapDevice()) {
Window.alert("detecting language");
phoneGap.getGlobalization().getLocaleName(new GlobalizationCallback<CLocale, GlobalizationError>() {
@Override
public void onSuccess(CLocale s) {
...
}
@Override
public void onFailure(GlobalizationError f) {
....
}
});
}
}
After that: phoneGap.initializePhoneGap();
Our html:
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" language="javascript" src="js/cordova-2.4.0.js"></script>
<meta name="gwt:property" content="locale=en">
<script src="js/init.js"></script>
<script type="text/javascript" language="javascript" src="asdf.mobileclient/asdf.mobileclient.nocache.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", (function(){ PhoneGap.available = true;}), false);
</script>
</head>
<body>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
</body>
</html>
And the configuration in the app (config.xml) sets the following plugin:
<plugin name="Globalization" value="org.apache.cordova.Globalization"/>
Thanks in advance.