How to achieve using phonegap app in android using senchatouch 2

I have a sample sencha touch2 app. It works fine in my localhost browser (http: //localhost/sencha/examples/navigationview/index.html).

Now I need to integrate this sencha app on Android using phonegap 1.5.0.

i downloaded the phonebook libraries from phonegap

phonegap-phonegap-1.5.0-0-gde1960d.zip from the telephone mailing list site. in that I have cordova-1.5.0.js and cordova-1.5.0.jar file instead of phone call.
I got to know the phonegap site which found out that cordova-1.5.0 and the phone splash screen are the same.

I followed this Getting Started Guide
In what they didn't give how to integrate sencha touch2 MVC file architecture. The basic example in the getting started guide works great for me.

My problem is that I was unable to integrate my sencha2 MVC file architecture. I googled this but it didn't work out. Am I doing something wrong here? Can you please suggest me the correct way to do this.
Thanks in Advance.

this is my index.html file

<!DOCTYPE HTML>
<html manifest="" lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>Ajax</title>
     <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
    <script id="microloader" type="text/javascript" src="development.js"></script>   
</head>
<body>
</body>
</html>

      

In my app.js file, I get the error:

   //<debug>
    Ext.Loader.setPath({ // line no. 2
        'Ext': 'src'
    });
    //</debug>

      

+3


source to share


4 answers


Ext.Loader

is what allows your JS files to live in different folders within a folder app

. Sencha Touch can dynamically download files from the appropriate directory if you configured Ext.Loader

as described in the tutorial

Then just put the folder index.html

app

and everything else in www

for Phonegap. It works the same as a web page. To be completely explicit:



www
 |
 |-index.html
 |-app/
 |-css/
 |-whatever else

      

+3


source


To create an assembly, you need to use a command line tool that gives you one js file including all MVC components and additional functionality like API or libs, you need PLUS all the EXT and sencha stuff you need and nothing more.



Reaching this stage is an achievement and then you should have an index.html file ready to render in the APK.

0


source


I would advise you to use MDS to applaud the phone space http://wiki.phonegap.com/w/page/34483744/PhoneGap%20Eclipse%20PlugIn%20for%20Android

for developing Sencha 2 apps with a phone gap. This will give you phone + sencha experience you can add ur sencha js and css file path to index.html and add app folder manually. the index will look like

  <!DOCTYPE HTML>
   <html>
   <head>
   <meta name="viewport" content="width=320; user-scalable=no" />
   <meta http-equiv="Content-type" content="text/html; charset=utf-8">
   <title>PhoneGap Demo with Sencha Touch</title>
   <link rel="stylesheet" href="sencha/resources/css/sencha-touch.css" type="text/css">
   <script type="text/javascript" src="sencha/sencha-touch-all.js"></script>
  <script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
  <script type="text/javascript" charset="utf-8" src="main.js"></script>
  <script type="text/javascript" charset="utf-8" src="phonegapdemo-w-sencha.js">        </script>
  </head>

      

0


source


Take a look at phonegap-build. See my answers here on the phone forum. You get the sencha app that works right away on iphone, Android, Blackberry, and more!

You don't even need to use the Phonegap API calls!

You only need to make a copy of app.html in index.html.

If you want to use the PhoneGap API, just use it. No added files required or anything else. In index.html you need to add the line

<script...  phonegap="cordova-1.0.7" /> 

      

or either version is then valid.

(This info is correct as of June 11, 2012 - I'm guessing when the beta ends it will be worth it)

0


source







All Articles