Reputation: 792
I've an example sencha touch2 application. It is working fine in my localhost browser(http://localhost/sencha/examples/navigationview/index.html).
Now i need to integrate this sencha applicaiton to android using phonegap 1.5.0.
i've downloaded phonegap libraries from phonegap
phonegap-phonegap-1.5.0-0-gde1960d.zip from phonegap website.
in that i've got cordova-1.5.0.js and cordova-1.5.0.jar file instead of phonegap.
I've gone through with phonegap site got to know that cordova-1.5.0 and phonegap is same.
I've followed this Get Started Guide
In that they have not given how to integrate sencha touch2 MVC file architecture. The basic example in get started guide is working fine for me.
My Problem is i couldnt able to integrate my sencha2 MVC file architecture. I've googled this but didnt get succeed. I'm doing any thing wrong here? Can you suggest me the right 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 app.js file i'm getting Error:
//<debug>
Ext.Loader.setPath({ // line no. 2
'Ext': 'src'
});
//</debug>
Upvotes: 3
Views: 3564
Reputation: 4063
Take a look at phonegap-build. See my answers here on the forum about phonegap. You get your sencha app running immediately on iphone, android, blackberry and everything else !!
You don't even need to use phonegap API calls!
You only have to make a copy of app.html into index.html.
If you DO want to use the phoneGap API, simply use it. No added files needed or anything else. In the index.html you have to add the line
<script... phonegap="cordova-1.0.7" />
or whatever version is then valid.
(This info is true as of June 11, 2012 -- I suppose when beta period is over it will cost)
Upvotes: 0
Reputation: 1544
I would suggest you to use MDS applaud phone gap http://wiki.phonegap.com/w/page/34483744/PhoneGap%20Eclipse%20PlugIn%20for%20Android
for developing sencha 2 applications with phone gap . It will give you a way to work with phonegap+sencha you can then add the path to ur sencha js and css file in the index.html and manually need to add the app folder. the index would 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>
Upvotes: 0
Reputation: 478
For a production build you need to use the command line tool which gives you a single js file including all the MVC components and extras like API's or libs you need PLUS all the necessary EXT and sencha stuff stuff and no more.
Getting to that stage is quite an achievement and then you should have your index.html file ready to make into an APK.
Upvotes: 0
Reputation: 3531
Ext.Loader
is what allows your JS files to live in different folders inside the app
folder. Sencha Touch can dynamically load your files from the appropriate directory if you have configured Ext.Loader
as described in the tutorial
Then just put the index.html
the app
folder and everything else into www
for Phonegap. It works just the same as a web page. To be completely explicit:
www
|
|-index.html
|-app/
|-css/
|-whatever else
Upvotes: 3