﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>Developer docs by Indraneel Pole : Cordova</title><link />http://developers.de/blogs/indraneel/archive/tags/Cordova/default.aspx<description>Tags: Cordova</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>How to add icon to your Cordova App with Visual Studio Tools for Apache Cordova</title><link />http://developers.de/blogs/indraneel/archive/2016/06/02/how-to-add-icon-to-your-cordova-app-with-visual-studio-tools-for-apache-cordova.aspx<pubdate>Thu, 02 Jun 2016 14:45:36 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1790956</guid><dc:creator>Indraneel Pole</dc:creator><slash:comments>1</slash:comments><wfw:commentrss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://developers.de/blogs/indraneel/rsscomments.aspx?PostID=1790956</wfw:commentrss><comments>http://developers.de/blogs/indraneel/archive/2016/06/02/how-to-add-icon-to-your-cordova-app-with-visual-studio-tools-for-apache-cordova.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Setting app icon is usually very straight forward task in application development, and thus should not require a dedicated blogpost for this. However, while using Apache Cordova in Visual Studio environment, it becomes slightly tricky.&lt;/p&gt;  &lt;p&gt;So, why is it tricky? That is because Visual Studio TACO (&lt;strong&gt;T&lt;/strong&gt;ools for &lt;strong&gt;A&lt;/strong&gt;pache &lt;strong&gt;CO&lt;/strong&gt;rdova) shows the config.xml file differently than you usually see XML file. It shows all the important configurations such as plugins, version, name of the application etc. in a user friendly interface - &lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_190E43EF.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;float:none;padding-top:0px;padding-left:0px;margin-left:auto;border-left:0px;display:block;padding-right:0px;margin-right:auto;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_thumb_5F00_58D82A74.png" width="349" height="162" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;However this doesn’t show where the icon should be set. To do so, you need to see the actual XML code and make changes there.&lt;/p&gt;  &lt;p&gt;First, add the icon image in your application’s res folder under the platform that you are using. for me it is Android. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_1FC14D72.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;float:none;padding-top:0px;padding-left:0px;margin-left:auto;border-left:0px;display:block;padding-right:0px;margin-right:auto;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_thumb_5F00_7FA640B4.png" width="244" height="222" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once that is done, right click on config.xml and click on view code (Can also be done with F7) Now here, inside every platform attribute, you will have an icon attribute. Add your icon path as source here. You can optionally select density (For Android) or width and height (For iOS and Windows).&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_468F63B2.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;float:none;padding-top:0px;padding-left:0px;margin-left:auto;border-left:0px;display:block;padding-right:0px;margin-right:auto;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_thumb_5F00_7887043C.png" width="244" height="43" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And that’s all. The icon is set for the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1790956" width="1" height="1"&gt;</description><category domain="http://developers.de/blogs/indraneel/archive/tags/Cordova/default.aspx">Cordova</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Cross+platform+development/default.aspx">Cross platform development</category><category domain="http://developers.de/blogs/indraneel/archive/tags/ApacheCordova/default.aspx">ApacheCordova</category></item><item><title>Hiding notification bar for Android Apps using Visual Studio tools for Apache Cordova</title><link />http://developers.de/blogs/indraneel/archive/2016/01/23/hiding-notification-bar-for-android-apps-using-visual-studio-tools-for-apache-cordova.aspx<pubdate>Sat, 23 Jan 2016 17:32:09 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1700431</guid><dc:creator>Indraneel Pole</dc:creator><slash:comments>0</slash:comments><wfw:commentrss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://developers.de/blogs/indraneel/rsscomments.aspx?PostID=1700431</wfw:commentrss><comments>http://developers.de/blogs/indraneel/archive/2016/01/23/hiding-notification-bar-for-android-apps-using-visual-studio-tools-for-apache-cordova.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;While making your Android app full-screen (hiding the notification bar on the top) is quite easy in the Native environment where you can simply add the configuration in Manifest.xml file, if you are doing the cross-platform application development using some tool such as Apache Cordova, things become a little bit trickier.&lt;/p&gt;  &lt;p&gt;I am using EXT JS and Sencha Touch as the web framework for my Mobile Application and Cordova just as a platform for compilation, peripheral support and so on. So my first idea was to look for the configuration in Sencha Touch framework, however a simple search on Sencha Forum showed me that it is not possible to do this through Sencha as Ext JS does not provide any meta tag for this, and is dependent on UI’s web view to do this. It is possible to access the manifest.xml file using Sencha CMD, but if you are using Sencha Touch with Cordova in Visual Studio, and you are not using Sencha CMD, things become tricky.&lt;/p&gt;  &lt;p&gt;Thankfully, Cordova has made it very easy to do so. All you have to do is, go to config.xml file in of your solution. If you use Visual Studio tools for Apache Cordova, you will see something like this -&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/Untitled_5F00_0D70FFC2.png"&gt;&lt;img title="Untitled" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="Untitled" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/Untitled_5F00_thumb_5F00_0651C34A.png" width="316" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You simply need to select the Fullscreen option to yes or no, and it will make the desired change for you. If you want to hide the navigation bar select yes, otherwise simply select no (It is by default no in my knowledge).&lt;/p&gt;  &lt;p&gt;I hope this helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1700431" width="1" height="1"&gt;</description><category domain="http://developers.de/blogs/indraneel/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Cordova/default.aspx">Cordova</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>JavaScript runtime error - Unable to add dynamic content</title><link />http://developers.de/blogs/indraneel/archive/2015/10/20/javascript-runtime-error-unable-to-add-dynamic-content.aspx<pubdate>Tue, 20 Oct 2015 15:35:27 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1585438</guid><dc:creator>Indraneel Pole</dc:creator><slash:comments>0</slash:comments><wfw:commentrss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://developers.de/blogs/indraneel/rsscomments.aspx?PostID=1585438</wfw:commentrss><comments>http://developers.de/blogs/indraneel/archive/2015/10/20/javascript-runtime-error-unable-to-add-dynamic-content.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So, lately I am working on Cordova (Or previously known as Phonegap) tools for Visual Studio to build a cross platform application using JavaScript and HTML. I imported some pre-written JavaScript code to Cordova and while it worked for me on Android Emulators, trying to run it on Windows Phone was a bit struggling. While trying to deploy it on Windows device, it threw an exception saying &amp;quot;JavaScript runtime error - Unable to add dynamic content.&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_69D78C44.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/indraneel/image_5F00_thumb_5F00_29A172CA.png" width="653" height="437" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After a little more probe (By commenting/uncommenting some lines basically), I realized that it is happening every time I try to dynamically load html page from JavaScript. (Which is also basically what the exception says but I had to do it myself).&lt;/p&gt;  &lt;p&gt;When I Googled about it, I found out that when you try to deploy some JS code on Windows devices, Microsoft uses some security principles to prevent un-sanitized markup which literally means adding HTML dynamically such as using innerHTML, outerHTML, document.write (That&amp;#39;s where exactly I stumbled) and so on will not be so easy in Cordova when using it on Windows devices. Thankfully I found an &lt;a href="https://msdn.microsoft.com/en-gb/library/windows/apps/hh767331.aspx"&gt;MSDN page&lt;/a&gt; that states how to tackle this issue. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How&lt;/strong&gt;: All the code that you are using to load HTML dynamically should be called inside a function of the &lt;a href="https://msdn.microsoft.com/en-gb/library/windows/apps/hh767332.aspx"&gt;MSApp&lt;/a&gt; called &lt;strong&gt;execUnsafeLocalFunction.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;: E.g. I want to use document.write inside my script.&lt;/p&gt;  &lt;p&gt;document.write(&amp;#39;&amp;lt;meta name=&amp;quot;&amp;#39;+example+&amp;#39;&amp;quot; content=&amp;quot;&amp;#39;+someContent+&amp;#39;&amp;quot;&amp;gt;&amp;#39;)&lt;/p&gt;  &lt;p&gt;This should be called inside:&lt;/p&gt;  &lt;p&gt;MSApp.execUnsafeLocalFunction(function () {    &lt;br /&gt;document.write(&amp;#39;&amp;lt;meta name=&amp;quot;&amp;#39;+example+&amp;#39;&amp;quot; content=&amp;quot;&amp;#39;+someContent+&amp;#39;&amp;quot;&amp;gt;&amp;#39;)     &lt;br /&gt;});&lt;/p&gt;  &lt;p&gt;And its works perfect!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1585438" width="1" height="1"&gt;</description><category domain="http://developers.de/blogs/indraneel/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Cordova/default.aspx">Cordova</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://developers.de/blogs/indraneel/archive/tags/Cross+platform+development/default.aspx">Cross platform development</category></item></channel></rss>