I am a dedicated Android developer who is diving into the world of Sencha Touch, Windows app development, and VisualStudio environments for the first time. Please excuse the detailed explanation of my problem, as I want to make sure all crucial details are covered.
The challenge I'm facing involves migrating an old Sencha Touch 2.1 (Cmd 3.0) based app designed for iPad (iOS), created by someone from Kepler-452b, to work on Android devices. I successfully transferred the app to an Android Cordova project in the "www" folder and it functions flawlessly on a Nexus 10 tablet. However, when attempting to migrate this app to Windows using VisualStudio 2013, I encountered some issues.
The goal is to transform the existing code into a Windows Store app that can run on Win 8/8.1 PC or an HP Omni 10 tablet.
Here are the steps I followed:
Create a sample Sencha app
>sencha generate app sample ../sample
Initialize Cordova
>sencha cordova init
Update app.json to add the Windows platform
"platforms": "windows"
Build for native packaging
>sencha app build native
Import the solution 'CordovaApp.sln' generated at \cordova\platforms\windows to VS2013
Running the project CordovaApp.Windows80 inside VS triggers an "Unable to add dynamic content" exception due to the Windows CSP
To resolve the issue, wrap the calls to "document.write" with MSApp.execUnsafeLocalFunction() in the minified microloader script inside index.html. This successfully launches the sample Sencha Touch app as a store app, although some tab icons get replaced. The app renders beautifully in IE and Chrome browsers.
In Windows Explorer, delete the contents of the \cordova\platforms\windows\www folder except for cordova.js and cordova_plugins.js
Copy the contents of my old Sencha project to the www folder, build, and launch the app inside VS. Encounter "Unable to add dynamic content" once again!
In /www/touch/microloader/development.js, update "function write(content)" to wrap document.write with MSApp.execUnsafeLocalFunction(). Another exception arises: "document.body does not exist at this point," possibly indicating an outdated framework version.
Replace the old 2.1 "touch" folder with the new 2.4.0 "touch" folder from my Sencha workspace and try running again.
Currently, there are no errors in the console, but the app only displays a white screen after the Cordova splash screen. Even by swapping out Main.js contents with those from the sample Sencha application, the screen remains blank. Adding an 'initialize' event listener confirms that the view is being loaded.
I am utilizing Sencha Cmd 6.0.0 and touch-2.4.0.
I have been grappling with this issue for over a week with no success. I checked StackOverflow here, but the guidance pertains to Ext JS rather than Sencha Touch. I'm unsure how the original poster resolved their issues.
I'm uncertain if my current approach is the right way to migrate an old Sencha Touch app to a Windows Store app.
Any assistance would be greatly appreciated.