How can I integrate Sencha Touch 2 into Cordova (Phonegap) project

cordova, sencha-touch-2

Solution

Just include the cordova.js file from the index.html file.

Problem

I'm trying to integrate a ST2 app into PhoneGap; but I'm having problems. I've added cordova.js into app.json: ``` { "path": "resources/js/cordova-1.6.1.js", "update": "delta" }, { "path": "resources/js/test.js", "update": "delta" } ``` Test.js : ``` function alertDismissed() {} function showAlert() { navigator.notification.alert( 'You are the winner!', // message alertDismissed, // callback 'Game Over', // title 'Done' // buttonName ); } ``` Inside a view, i've created a dummy button: ``` items: [{ text: 'test', action: showAlert(), }], ``` When i tap the button; the function 'showAlert()' is fired up correctly; but not being executed correctly i have an error : ``` Uncaught TypeError: Cannot call method 'alert' of undefined ``` Obviously because the object 'navigator' is not being instenciated. Question: is it possible to have both cordova/senchatouch2 run ? If so, what is the proper way to do it ? SOLVED: Add cordova.js prior to app.js ``` { "path": "resources/js/cordova-1.6.1.js", "update": "delta" }, { "path": "sdk/sencha-touch.js" }, { "path": "app.js", "update": "delta" }, ```

Original source