Sencha Touch App crashes on Windows Phone 8

前端 未结 1 661
心在旅途
心在旅途 2020-12-20 07:04

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

相关标签:
1条回答
  • 2020-12-20 08:01

    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 www\app.json
    

    In the csproj file should include the following elements:

    <Content Include = "www\app.json" /> 
    <Content Include = "www\resources\sample\data.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

    0 讨论(0)
提交回复
热议问题