Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

html - Sencha Touch App crashes on Windows Phone 8

I have developed an app for iOs and Android with Sencha Touch. Now i want bring these app to Windows Phone 8.

I migrated the framework to 2.2 and all works fine. In the internet explorer 10 on Windows 8 the app works great. But when i try to open the app on the windows phone with the browser, the app crashes alway on the same action.

I used a card layout and destroy the last view manually, because i made better experiences with this procedure.

I'm reale desperate, because i don't know where i can fix it. Unfortunately, there is no developer console like in chrome. From my manully bugfixing i know that the javascript code works till the and of the called function.

I also try the app as build with PhoneGap and there are the same problems.

Does any body know, if there are some problems with a Ext.Js container in card layout and windows phone 8?

And additional, does any body know a good way to check HTML/CSS/Javascript Code on the Windows Phone 8? Maybe on the same way like on the iPad.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I managed to successfully deploy an sencha touch application on windows phone 8 following the steps in the following link:

Deploy Sencha touch app on Windows Phone

I added the plugins I needed using the following command after installing Git and set it to be available from the command prompt of windows:

cordova plugin add <URL_GIT_REPO>

Instead of using the package files, I used the command:

sencha app build native

and I used the app.js and app.json files generated that were created in the path SenchaTouchAppFolder/build/native/AppName

also did the following: I had to get a developer account, and checked the device after installing visual studio 2012 express and windows phone SDK 8.

When deploying the application on the device in Debug mode, you can view exception messages in the output window of Visual Studio.

First make sure that the project includes the app.json file. For example to build the solution in the output window should display the following message:

1> Adding wwwapp.json

In the csproj file should include the following elements:

<Content Include = "wwwapp.json" /> 
<Content Include = "www
esourcessampledata.json" />

I also modified the following lines of code to add support for JSON responses needed in the model from my local storage in cordovalib/XHRHelper.cs file.

 var funk = function () {
                        window.__onXHRLocalCallback = function (responseCode, responseText) {
                            alias.status = responseCode;
                            if (responseCode == '200') {
                                alias.responseText = responseText;
                                try {
                                    JSON.parse(responseText);
                                } catch (e) {
                                    Object.defineProperty(alias, 'responseXML', {
                                        get: function () {
                                            return new DOMParser().parseFromString(this.responseText, 'text/xml');
                                        }
                                    });
                                }
                                Object.defineProperty(alias, 'responseJSON', {
                                    get: function () {
                                        return new DOMParser().parseFromString(this.responseText, 'text/json');
                                    }
                                });

                            }else {
                                alias.onerror && alias.onerror(responseCode);
                            }

A useful tool to debug css errors is the emulation tool internet explorer 11

F12 > Emulation > Explorer Profile > Windows Phone 

This tool can also be useful: Remote HTML5 debugging on Windows Phone with weinre


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...