I am a hardcore Android developer new to Sencha Touch, Windows app development and VisualStudio environments. So please bear with the lengthy description of the problem, just did not want to miss any crucial detail.
I have received an old Sencha Touch 2.1 (Cmd 3.0) based app that has been running on ipad (iOS), developed by someone from Kepler-452b. I recently ported the app to Android by copying the project contents to an android cordova project (www folder) and is working without a problem on a Nexus 10 tablet. I started facing issues while trying to migrate this for Windows using VisualStudio 2013.
The intention is to create a Windows Store app out of the existing code that can run on a Win 8/8.1 PC or a HP Omni 10 tablet.
Steps followed:
Create sample sencha app
>sencha generate app sample ../sample
Initialize cordova
>sencha cordova init
Update app.json to add windows platform
"platforms": "windows"
Build for native packaging
>sencha app build native
Import the solution 'CordovaApp.sln' generated at \cordova\platforms\windows to VS2013
Run the project CordovaApp.Windows80 inside VS and it slaps a "Unable to add dynamic content" exception due to the Windows CSP
Wrap the calls to "document.write" with MSApp.execUnsafeLocalFunction() in the minified microloader script inside index.html and run again. This successfully launches the sample sencha touch app as a store app (the icons in the tab bar for 'Home' and 'Get Started' tabs are replaced with a 'H' and 'R' though). Both IE and chrome browsers render the app beautifully with the icons
In Windows explorer, delete the contents of the \cordova\platforms\windows\www folder except the 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. "Unable to add dynamic content" again!
Inside /www/touch/microloader/development.js, update "function write(content)" to wrap the document.write with MSApp.execUnsafeLocalFunction() and run; another exception pops up: "document.body does not exist at this point" - google suggested that this could be due to an old framework version
Replace the old 2.1 "touch" folder inside the project with the new 2.4.0 "touch" folder from my sencha workspace and run again
Now there are no errors in the console, but the app only shows a white screen after the cordova splashscreen. If I replace contents of my Main.js with that from the sample sencha application, the screen is still white! By adding a 'initialize' event listener, I confirm that the view is being loaded
I am using Sencha Cmd 6.0.0 and touch-2.4.0
I ve been stuck with this for more than a week now to no avail. Had a look in stackoverflow here, but the instructions are for Ext JS and not Sencha Touch. No idea how the OP fixed the issues.
I am not sure if this is even the correct approach to migrate an old sencha touch app to a windows store app.
Any help would be much appreciated.