{"id":9233,"date":"2014-01-28T09:00:07","date_gmt":"2014-01-28T14:00:07","guid":{"rendered":"http:\/\/blog.xamarin.com\/?p=9233"},"modified":"2014-01-28T09:00:07","modified_gmt":"2014-01-28T14:00:07","slug":"visual-basic-goes-mobile-with-portable-libraries","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/visual-basic-goes-mobile-with-portable-libraries\/","title":{"rendered":"Visual Basic Goes Mobile with Portable Libraries"},"content":{"rendered":"<p>Since the dawn of iPhone, Visual Basic developers have asked the enduring question, \u201cCan I play too?\u201d With our recent announcement of <a href=\"\/pcl-projects-and-vs2013\/\">full support for Portable Class Library Projects<\/a> as part of our participation in the <a href=\"http:\/\/xamarin.com\/pr\/xamarin-microsoft-partner\">Visual Studio 2013 launch<\/a>, the answer is now a resounding \u201cYes! (Kinda.)\u201d<\/p>\n<p>Portable Class Libraries enable .NET developers to easily share code across iOS, Android, Windows Phone and Windows Store apps.  One of the hidden gems in Portable Class Libraries is that you can create portable Visual Basic libraries which can then be incorporated into Xamarin.iOS and Xamarin.Android apps.  While this doesn\u2019t constitute full support for Visual Basic, it does mean that a significant portion of your iOS and Android application logic can now be written in VB.<\/p>\n<p>To see how easy it is to bring your Visual Basic code into Xamarin projects via a Portable Library, visit our documentation portal for a <a href=\"http:\/\/docs.xamarin.com\/guides\/cross-platform\/application_fundamentals\/pcl\/portable_visual_basic_net\/\">complete example of creating a Visual Basic library and adding it to iOS, Android and Windows Phone apps<\/a>.<\/p>\n<pre class=\"lang:vb decode:true\">\n    Public Function SaveTask(item As Task) As Integer\n        Dim max As Integer = 0\n\n        If _tasks.Count &gt; 0 Then\n            max = _tasks.Max(Function(t As Task) t.ID)\n        End If\n        If item.ID = 0 Then\n            item.ID = ++max\n            _tasks.Add(item)\n        Else\n            Dim j = _tasks.Where(Function(t) t.ID = item.ID).First()\n            j = item\n        End If\n        _storage.WriteXml(_tasks, _filename)\n        Return max\n    End Function\n<\/pre>\n<p>Aside from giving VB developers the opportunity to eschew semicolons and enjoy the comfort of underscore concatenated new lines and keyword constrained conditional scoping, reusable Visual Basic application logic affords a serious opportunity for VB coders to more easily transfer their existing code and skills to mobile.  If you have existing Visual Basic.NET libraries, use the <a href=\"http:\/\/scan.xamarin.com\/\">Xamarin Mobility Scanner<\/a> to see how much of your existing Visual Basic can be brought into the mobile world.<\/p>\n<p><a href=\"http:\/\/forums.xamarin.com\/discussion\/12827\/\"><em>Discuss this blog post in the Xamarin Forums<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the dawn of iPhone, Visual Basic developers have asked the enduring question, \u201cCan I play too?\u201d With our recent announcement of full support for Portable Class Library Projects as part of our participation in the Visual Studio 2013 launch, the answer is now a resounding \u201cYes! (Kinda.)\u201d Portable Class Libraries enable .NET developers to [&hellip;]<\/p>\n","protected":false},"author":570,"featured_media":39167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[4],"class_list":["post-9233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-xamarin-platform"],"acf":[],"blog_post_summary":"<p>Since the dawn of iPhone, Visual Basic developers have asked the enduring question, \u201cCan I play too?\u201d With our recent announcement of full support for Portable Class Library Projects as part of our participation in the Visual Studio 2013 launch, the answer is now a resounding \u201cYes! (Kinda.)\u201d Portable Class Libraries enable .NET developers to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/9233","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\/570"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=9233"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/9233\/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=9233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=9233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=9233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}