0
votes

i'm following the mvc example in sencha touch page (http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/), to try to work in android, but im having a trouble at app variable, over a few files this is the error '08-14 16:01:52.245: D/CordovaLog(2087): file:///android_asset/www/app/views/Viewport.js: Line 1 : Uncaught ReferenceError: app is not defined'

does any one knows whats the problem?

here is may index file

<!DOCTYPE html>
<html>
    <head>
        <title>Contacts</title>

        <script type="text/javascript" src="lib/sencha/js/sencha-touch-all.js"></script>
        <link href="lib/sencha/css/sencha-touch.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="app/app.js"></script>

        <script type="text/javascript" src="app/views/Viewport.js"></script>
        <script type="text/javascript" src="app/models/Contact.js"></script>
        <script type="text/javascript" src="app/views/ContactsList.js"></script>



        <script type="text/javascript">
            document.addEventListener("deviceready", app.launch, false);
        </script>

        <style>
            h4 {
                background: #F7F7F7;
                font-weight: bold!important;
                margin: 0.5em 0 0!important;
                padding: 5px;
                border: solid #DDD;
                border-width: 1px 0;
            }
            .field {
                background:#FFFFFF;
                font-size: 120%;
                text-indent: -100px;
                border-bottom: 1px solid #DDD;
                padding:0.4em 0.4em 0.4em 100px;
            }
            .field .label {
                display: inline-block;
                color:#666;
                text-align:right;
                text-transform:capitalize;
                width: 100px;
                padding-right:1em;
            }
        </style>

    </head><body></body>
</html>

PD I already try, to change the name of the var at app.js file but it doesn't work

1
Haven't read that one but sencha.com/blog/… was an awesome beginning for me. Dead simple and in 3rd part they guide on how to package the app with phonegap. regardscode4jhon

1 Answers