I am working on a mgwt-phonegap application.
I am using this code:
final PhoneGap phoneGap = GWT.create(PhoneGap.class);
phoneGap.addHandler(new PhoneGapAvailableHandler() {
@Override
public void onPhoneGapAvailable(PhoneGapAvailableEvent event) {
//start your app - phonegap is ready
Window.alert("phonegap is ready");
}});
phoneGap.addHandler(new PhoneGapTimeoutHandler() {
@Override
public void onPhoneGapTimeout(PhoneGapTimeoutEvent event) {
//can not start phonegap - something is for with your setup
Window.alert("can not start phonegap");
}});
phoneGap.initializePhoneGap();
When I am using the compiled code from the target folder, to phonegap i.e assets/www folder and running the phonegap application. It is giving me this error:
_gwt$exception : Cannot read property 'uuid' of undefined
This is the script I am using on index.html page:
<script type="text/javascript" language="javascript" src="cordova.js"></script>
<script type="text/javascript" language="javascript" src="MyApplication/MyApplication.nocache.js">
</script>
<script type="text/javascript">
document.addEventListener("deviceready", (function() {
cordova.available = true;
}), false);
This particular code is catching this exception:
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
// TODO put in your own meaninful handler
Window.alert("uncaught: " + e.getMessage());
e.printStackTrace();
}
});
Just to elaborate more:
Add device plugin just as mentioned below. http://docs.phonegap.com/en/3.3.0/cordova_device_device.md.html
Regards, Sandip