{"id":35068,"date":"2018-02-05T13:50:43","date_gmt":"2018-02-05T21:50:43","guid":{"rendered":"https:\/\/blog.xamarin.com\/?p=35068"},"modified":"2019-08-15T12:15:37","modified_gmt":"2019-08-15T19:15:37","slug":"draw-next-app-idea-ink-code","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/draw-next-app-idea-ink-code\/","title":{"rendered":"Draw your Next App Idea with Ink to Code"},"content":{"rendered":"<p>Imagine that you&#8217;ve just been struck by inspiration for your next great app. You might start by jotting some notes and sketching out screens. If you&#8217;re thinking about reaching for a sketchbook, a whiteboard, or even the back of a napkin, think about reaching for your computer and installing <em><strong><a href=\"https:\/\/www.microsoft.com\/en-us\/garage\/profiles\/ink-to-code\/\">Ink to Code<\/a><\/strong><\/em> instead.<\/p>\n<p><em>Ink to Code<\/em>, a Microsoft Garage project, is the digital version of the back of a napkin for your app ideas. A nimble Windows 10 app, it launches in seconds and provides a quick canvas for you to sketch out screens with your stylus. Let\u2019s give it a try!<\/p>\n<h2>Getting Started<\/h2>\n<p>The first thing you\u2019ll want to do is <a href=\"http:\/\/aka.ms\/geti2c\">install <em>Ink to Code<\/em> from the Microsoft Store<\/a>. Upon launching it, you\u2019ll be greeted by its minimal user interface and large drawing area. To get some guidance on what to draw, click the <strong>Guide<\/strong> button in the toolbar. This shows you the different design elements that <em>Ink to Code<\/em> recognizes:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-35069\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/I2cPic1.png\" alt=\"Ink to Code Guide\" width=\"800\" height=\"649\" \/><\/p>\n<h2>Drawing Your App with Ink to Code<\/h2>\n<p>Let\u2019s pretend you&#8217;re inspired to make the next great tip calculator. This video illustrates how you might draw it in <em>Ink to Code<\/em>:<\/p>\n<p><div style=\"width: 2062px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-35068-1\" width=\"2062\" height=\"1764\" poster=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/i2cposter.png\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/i2c3.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/i2c3.mp4\">https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/i2c3.mp4<\/a><\/video><\/div><\/p>\n<p>&nbsp;<\/p>\n<p>As you draw each design element, you\u2019ll notice that <em>Ink to Code<\/em> converts the ink strokes into recognized components. Tapping on each of these items displays a menu that allows you to delete them, or if they were misrecognized, convert them into different components. You\u2019ll also notice that tapping the second button in the left toolbar switches into constraint mode, where you can draw constraint lines that can be used to align other elements.<\/p>\n<p>How does this magic work? Internally, <em>Ink to Code<\/em> uses the powerful <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/design\/input\/pen-and-stylus-interactions\">Windows Ink platform<\/a> and some of its own heuristics to recognize common design elements in your app sketches and then convert them into UWP XAML or Android layout XML that can be loaded directly into Visual Studio.<\/p>\n<h2>Exporting to Visual Studio<\/h2>\n<p><em>Ink to Code<\/em> is great for quickly sketching the broad strokes of your app idea, but to start refining it into a prototype, you\u2019ll want to export your drawings to Visual Studio. For this exercise, we\u2019ll build a Xamarin.Android app:<\/p>\n<ol>\n<li>Click the <strong>Export<\/strong> button in the <em>Ink to Code<\/em> toolbar and choose <strong>Android<\/strong> from the menu. Then choose a temporary directory in which to export the layout XML file.\n<img decoding=\"async\" class=\"aligncenter wp-image-35072\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/I2cPic2.png\" alt=\"Ink to Code Android Export Button\" width=\"740\" height=\"200\" \/><\/li>\n<li>Open Visual Studio 2017 and create a new Blank Android App project. If you cannot find the project template, <a href=\"https:\/\/developer.xamarin.com\/guides\/cross-platform\/getting_started\/installation\/windows\/\">ensure that you have Xamarin installed<\/a>. You can also use Visual Studio for Mac and ensure <strong>Android<\/strong> is selected during <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/mac\/installation\">installation<\/a>.<\/li>\n<li>Find <code>Main.axml<\/code> in your Android project under the path <code>Resources\\layout<\/code>. Replace it with the file you exported in the first step.<\/li>\n<li><em>Ink to Code<\/em> uses <code>ConstraintLayout<\/code> in its exported Android XML, so you\u2019ll need to add the <a href=\"https:\/\/www.nuget.org\/packages\/Xamarin.Android.Support.Constraint.Layout\/\">Android.Support.Constraint.Layout<\/a> NuGet package to your project.<\/li>\n<li>Click Run, and you should see the screen you sketched launch in an Android emulator as real, interactive Android widgets!<\/li>\n<\/ol>\n<p>You\u2019ll probably want to continue refining your layout in Visual Studio after you export it from <em>Ink to Code<\/em>. To do this, simply double click on the <code>Main.axml<\/code> file and the Xamarin Android Designer will open:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-35074\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/I2cPic3.png\" alt=\"Exported Android Layout in Visual Studio 2017\" width=\"800\" height=\"616\" \/><\/p>\n<h2>Unleash your Creativity!<\/h2>\n<p>Now that you have an idea of how you can use <em>Ink to Code<\/em> to quickly sketch your next app idea, it\u2019s time to let your imagination run wild! <em>Ink to Code<\/em> is a Microsoft Garage project, which means it\u2019s an experiment and <a href=\"https:\/\/aka.ms\/i2cfeedback\">your feedback<\/a> will be pivotal in shaping its future.<\/p>\n<p>So please <a href=\"https:\/\/aka.ms\/geti2c\">install <em>Ink to Code<\/em><\/a>, sketch your next great app idea, and <a href=\"https:\/\/aka.ms\/i2cfeedback\">let us know<\/a> how it goes. Happy inking!<\/p>\n<p><a href=\"https:\/\/forums.xamarin.com\/122003\">Discuss this post in the Xamarin Forums.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine that you&#8217;ve just been struck by inspiration for your next great app. You might start by jotting some notes and sketching out screens. If you&#8217;re thinking about reaching for a sketchbook, a whiteboard, or even the back of a napkin, think about reaching for your computer and installing Ink to Code instead. Ink to [&hellip;]<\/p>\n","protected":false},"author":566,"featured_media":39167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[5,4],"class_list":["post-35068","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-android","tag-xamarin-platform"],"acf":[],"blog_post_summary":"<p>Imagine that you&#8217;ve just been struck by inspiration for your next great app. You might start by jotting some notes and sketching out screens. If you&#8217;re thinking about reaching for a sketchbook, a whiteboard, or even the back of a napkin, think about reaching for your computer and installing Ink to Code instead. Ink to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/35068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/566"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=35068"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/35068\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/39167"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=35068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=35068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=35068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}