Wednesday, 15 May 2013

gwt - Globalization is undefined and onPhoneGapAvailable doesn't fire -


Text after "

We are trying to develop a phonegap application with GWT, PhoneGap 2.4, 2.4 gwtphonegap. Now we are testing it against Android 4.2. We have used geographic content and it works like a charm in browser and mobile, but when we try to use globalization to take the system locale, it does not work. . OnPhneGapAvailable event never fire and if we call getGlobalization it says it keeps unscheduled directly

We call this method from an onPhoneGapAvailable event:

  Private zero detectLanguage () { / / If it is a mobile language, take the language from the OS (phoneGap.isPhoneGapDevice ()) {Window.alert ("language detection"); . PhoneGap.getGlobalization () getLocaleName (New GlobalizationCallback & lt; CLocale, GlobalizationError & gt; () {@Override Public Zero onSuccess (CLocale s) {...} @Override Public Zero onFailure (GlobalizationError f) {....} }); }}   

After that: phoneGap.initializePhoneGap ();

Our HTML:

  & lt; Doctype html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Script type = "text / javascript" language = "javascript" src = "js / cordova -2.4.0 .js" & gt; & Lt; / Script & gt; & Lt; Meta name = "gwt: property" content = "locale = en" & gt; & Lt; Script src = "js / init.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" language = "javascript" src = "asdf.mobileclient / asdf.mobileclient.nocache.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Document.addEventListener ("deviceready", (function () {PhoneGap.available = true;}), false); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Iframe src = "javascript: '' id =" __gwt_historyFrame "tabIndex = '- 1' style =" status: complete; Width: 0; Height: 0; Limit: 0 "& lt; / iframe>     

and in the app (config.xml) The configuration sets the following plugins:

  Plugin name = "globalization" value = "org. Apache.cordova.Globalization "/>   

Thanks in advance.

You have to wait forever, phonegap registers on the event GWT-Phonegap "Divisorred" event and will later set fire to the GWT event.

Any part of the API's API Accessing will not work.

No comments:

Post a Comment