{"id":671,"date":"2016-02-18T07:00:00","date_gmt":"2016-02-18T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/2016\/02\/18\/leveraging-native-ui-in-apache-cordova-apps-using-project-ace\/"},"modified":"2019-03-07T13:04:57","modified_gmt":"2019-03-07T20:04:57","slug":"leveraging-native-ui-in-apache-cordova-apps-using-project-ace","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/leveraging-native-ui-in-apache-cordova-apps-using-project-ace\/","title":{"rendered":"Leveraging Native UI in Apache Cordova Apps Using Project Ace"},"content":{"rendered":"<p><em>This article comes to us from Premier Developer consultant <\/em><a href=\"https:\/\/www.linkedin.com\/in\/waelkdouh\" target=\"_blank\" rel=\"noopener\"><em>Wael Kdouh<\/em><\/a><em>.<\/em><\/p>\n<p>When it comes to Cross Platform Mobile Development there are two options that stand out today. The first option is <a href=\"http:\/\/xamarin.com\/\" target=\"_blank\" rel=\"noopener\">Xamarin<\/a> which allows users to use C# and <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/cc295302.aspx\" target=\"_blank\" rel=\"noopener\">XAML<\/a> to develop once and deploy everywhere natively. The second option is <a href=\"https:\/\/cordova.apache.org\/\" target=\"_blank\" rel=\"noopener\">Apache Cordova<\/a> which allows users to use their web skills (JS, CSS, and HTML) to develop once and deploy a native shell everywhere that hosts a WebView.<\/p>\n<h4>The Need for Native UI<\/h4>\n<p>Whereas Apache Cordova resonates a lot with teams that utilize their web skills to build Cross Platform Mobile Development, there are many instances where people desire to mix native UI controls with the Cordova WebView capabilities. Some typical scenarios for using Native UI include:<\/p>\n<p><b>Case 1<\/b>: Utilizing an existing UI component that the development team doesn\u2019t want to rewrite in HMTL\/CSS\/JS.<\/p>\n<p><b>Case2<\/b>: Using a specific UI animation that is created with a tool like <a href=\"https:\/\/developer.apple.com\/xcode\/\" target=\"_blank\" rel=\"noopener\">Xcode<\/a> interface builder which the team wants to integrate with the rest of the Apache Cordova application.<\/p>\n<h4>Project Ace<\/h4>\n<p><a href=\"http:\/\/microsoft.github.io\/ace\/\" target=\"_blank\" rel=\"noopener\">Ace<\/a> is a prototype to enable mixing native UI with Cordova. It can be included in Apache Cordova project as a plugin which means it can easily be integrated into your existing Ionic or Cordova app development workflow. Things like attaching debuggers to the WebView, or live-reload continue to work like before.<\/p>\n<h5>What can you do with Project Ace?<\/h5>\n<p>The following combinations are possible with Ace:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35935\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cordova1.png\" alt=\"\" width=\"322\" height=\"244\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cordova1.png 322w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cordova1-300x227.png 300w\" sizes=\"(max-width: 322px) 100vw, 322px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35936\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd2.png\" alt=\"\" width=\"544\" height=\"363\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd2.png 544w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd2-300x200.png 300w\" sizes=\"(max-width: 544px) 100vw, 544px\" \/><\/p>\n<p align=\"center\">\n<p>&nbsp;<\/p>\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35937\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd3.png\" alt=\"\" width=\"136\" height=\"296\" \/><\/p>\n<p align=\"center\">\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35938\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd4.png\" alt=\"\" width=\"551\" height=\"377\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd4.png 551w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd4-300x205.png 300w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><\/p>\n<p align=\"center\">\n<p>&nbsp;<\/p>\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35939\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd5.png\" alt=\"\" width=\"295\" height=\"256\" \/><\/p>\n<p align=\"center\">\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35940\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd6.png\" alt=\"\" width=\"575\" height=\"319\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd6.png 575w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd6-300x166.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Ace also supports Android specific capabilities like floating and widgets.<\/p>\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35941\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd7.jpg\" alt=\"\" width=\"163\" height=\"292\" \/><img decoding=\"async\" class=\"alignnone size-full wp-image-35942\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd8.jpg\" alt=\"\" width=\"160\" height=\"295\" \/><\/p>\n<p align=\"center\">\n<p>Ace exposes different ways of building raw native controls directly:<\/p>\n<p align=\"center\"><img decoding=\"async\" class=\"alignnone size-full wp-image-35943\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd9.png\" alt=\"\" width=\"661\" height=\"358\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd9.png 661w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd9-300x162.png 300w\" sizes=\"(max-width: 661px) 100vw, 661px\" \/><\/p>\n<p>In addition to native UI, Ace also enables calling native APIs using JavaScript without having to write a plugin to do the job. The code could be your code, third party code, as well as platform APIs. In addition, you can directly add Java, Objective-C, and Android resources to your Cordova project ( by adding a native folder which includes platform specific code) so you can easily leverage them. Ace provides a reflection-like API to achieve this.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35944\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd10.jpg\" alt=\"\" width=\"338\" height=\"82\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd10.jpg 338w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd10-300x73.jpg 300w\" sizes=\"(max-width: 338px) 100vw, 338px\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35945\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd11.jpg\" alt=\"\" width=\"502\" height=\"184\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd11.jpg 502w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd11-300x110.jpg 300w\" sizes=\"(max-width: 502px) 100vw, 502px\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35946\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd12.jpg\" alt=\"\" width=\"320\" height=\"80\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd12.jpg 320w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd12-300x75.jpg 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35947\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd13.png\" alt=\"\" width=\"491\" height=\"225\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd13.png 491w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2016\/02\/cd13-300x137.png 300w\" sizes=\"(max-width: 491px) 100vw, 491px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Next Steps<\/h4>\n<p>Ace is still a prototype and will be refined based on the feedback from developers. If you think this is an interesting scenario for your app or have questions about the idea, you can get in touch with the product team at <a href=\"mailto:panarasi@microsoft.com\">panarasi@microsoft.com<\/a> or open issues on the <a href=\"https:\/\/github.com\/Microsoft\/ace\/issues\">github page of Project Ace<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article comes to us from Premier Developer consultant Wael Kdouh. When it comes to Cross Platform Mobile Development there are two options that stand out today. The first option is Xamarin which allows users to use C# and XAML to develop once and deploy everywhere natively. The second option is Apache Cordova which allows [&hellip;]<\/p>\n","protected":false},"author":581,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[185,190,71,311,98,88],"class_list":["post-671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-permierdev","tag-cordova","tag-cross-platform","tag-mobile-development","tag-project-ace","tag-wael-kdouh","tag-xamarin"],"acf":[],"blog_post_summary":"<p>This article comes to us from Premier Developer consultant Wael Kdouh. When it comes to Cross Platform Mobile Development there are two options that stand out today. The first option is Xamarin which allows users to use C# and XAML to develop once and deploy everywhere natively. The second option is Apache Cordova which allows [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=671"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/671\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}