{"action":"created","comment":{"url":"https://api.github.com/repos/auth0/blog/pulls/comments/57542806","id":57542806,"diff_hunk":"@@ -0,0 +1,600 @@\n+---\n+layout: post\n+title: \"Build and Authenticate Xamarin Cross-Platform Mobile Apps\"\n+description: \"Learn how to build and authenticate cross-platform mobile apps written in C# with Xamarin\"\n+date: 2016-03-29 09:38\n+author: \n+  name: \"Ado Kukic\"\n+  url: \"https://twitter.com/kukicadnan\"\n+  mail: \"ado@auth0.com\"\n+  avatar: \"https://s.gravatar.com/avatar/99c4080f412ccf46b9b564db7f482907?s=200\"\n+design: \n+  bg_color: \"#333333\"\n+  image: <A PATH TO A 200x200 IMAGE>\n+tags: \n+- Xamarin\n+- Xamarin Authentication\n+- C#\n+- Cross-Platform\n+- Native\n+- Hybrid\n+- Responsive Web\n+---\n+\n+---\n+\n+**TL;DR** Developers have a lot of options when deciding to building mobile apps. Xamarin allows developers to build cross-platform apps using C#. Learn how to build a cross-platform Android and iOS application utilizing a single codebase and add user authentication with Auth0.\n+\n+---\n+\n+The importance of having a great mobile app cannot be understated. The good news is developers have a lot of options on how to build mobile apps. **Native**, **hybrid**, **responsive web** - and the frameworks that come with them give developers a lot of flexibility and they all have pros and cons. Native development will likely grant the best performance, but you'll have to maintain each platform separately. Hybrid development will allow you to target multiple platforms with one codebase, but you won't get the same performance. Responsive web will allow you to convert your web app to a mobile friendly version quickly, but you won't be able to access the native device features and APIs nor the app stores.\n+\n+The general rule of thumb when building any application is that you should build it with the technology you are most familiar with. Building a native iOS app for the \"performance\" benefits when you have zero Objective-C knowledge will likely yield a negative result. [Xamarin](https://www.xamarin.com/) is a framework for building cross-platform applications in C#, so if you've ever worked with the Microsoft technology stack, you should feel right at home. In today's post, we'll build a cross-platform iOS and Android app with Xamarin.\n+\n+## Why Xamarin?\n+\n+Xamarin allows you to build native iOS, Android, Windows and Mac applications in C#. The company was founded by the creators of [Mono](http://www.mono-project.com/) and recently [acquired](https://blog.xamarin.com/a-xamarin-microsoft-future/) by Microsoft. Over 1 million developers are using Xamarin to build apps like [CineMark](http://www.cinemark.com/mobile-apps-cinemode), [MixRadio](https://play.google.com/store/apps/details?id=com.mixradio.droid&hl=en) and [Bastion](https://itunes.apple.com/us/app/bastion/id537773100?mt=8). Xamarin is a great fit for companies who are already embedded in the Microsoft stack and have developers with extensive C# knowledge. The Xamarin Platform runs on both Windows and Mac so you truly are not limited to the Windows ecosystem but have the full strength of C# at your disposal.\n+\n+C# is an excellent programming language. Statically typed, object-oriented, garbage collected and asynchronous are just some of the benefits. With Xamarin, your entire app will be written in C# and then compiled to it's native binary. The Xamarin Platform exposes platform specific APIs when needed, interfaced again with C#, but generally you will be able to write the majority of your code once and have it run everywhere.\n+\n+## Getting Started with Xamarin\n+\n+Let's dive in and setup Xamarin. The first thing we'll need is the actual Xamarin Platform installed on our machine. Head over the the Xamarin website and [download](https://www.xamarin.com/download) it. Once downloaded, the installer will ask you which platforms you are planning on developing for and will download additional dependencies automatically. If you are developing on a Windows machine, you can alternatively use Visual Studio, but as this is a tutorial introducing Xamarin - we'll stick to Xamarin Studio.\n+\n+### Setting Up the Solution\n+\n+![Xamarin Studio New Solution](https://cdn.auth0.com/blog/xamarin/xamarin-studio-setup-solution.png)\n+\n+With Xamarin Studio installed, we are ready to create our first project. Open up Xamarin Studio and click the **New Solution** button in the top left corner to get started. The first screen we're presented with will ask us what type of application we're building. We'll select **Cross-Platform App** as we're building an application that we want available on iOS and Android. We'll select a **Xamarin.Forms** app and on the next screen we'll name our app - **CloudCakes**, select our target platforms (Android and iOS) and select the **Use Shared Library** in the sharing section. The Shared Code selection does not matter much for us in this demo but to learn about the differences and when you might use one over the other check out the Xamarin [docs](https://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/).\n+\n+![Xamarin Solution Setup](https://cdn.auth0.com/blog/xamarin/solution-setup.png)\n+\n+Finally, we'll select a directory for our project and we'll be ready to go.\n+\n+### Project Structure\n+\n+With a new solution created, let's explore how Xamarin setup the project for us. There are 3 root level directories: **CloudCakes**, **CloudCakes.Droid**, **CloudCakes.iOS** - or if you named your app something different it'll follow the pattern **{AppName}**, **{AppName}.Droid**, **{AppName}.iOS**. We will spend the majority of our time in the main directory as any code written here will be shared between the Android and iOS versions of the app. The more code we can write in the main directory the better.","path":"_posts/2016-03-29-build-a-cross-platform-mobile-app-with-xamarin.markdown","position":56,"original_position":56,"commit_id":"cab132682ead3852ddd920e17cdaa7cf2f8a5755","original_commit_id":"cab132682ead3852ddd920e17cdaa7cf2f8a5755","user":{"login":"chenkie","id":1847678,"avatar_url":"https://avatars.githubusercontent.com/u/1847678?v=3","gravatar_id":"","url":"https://api.github.com/users/chenkie","html_url":"https://github.com/chenkie","followers_url":"https://api.github.com/users/chenkie/followers","following_url":"https://api.github.com/users/chenkie/following{/other_user}","gists_url":"https://api.github.com/users/chenkie/gists{/gist_id}","starred_url":"https://api.github.com/users/chenkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenkie/subscriptions","organizations_url":"https://api.github.com/users/chenkie/orgs","repos_url":"https://api.github.com/users/chenkie/repos","events_url":"https://api.github.com/users/chenkie/events{/privacy}","received_events_url":"https://api.github.com/users/chenkie/received_events","type":"User","site_admin":false},"body":"`solution` => `app` (maybe?)\r\n`3` => `three`","created_at":"2016-03-28T03:43:51Z","updated_at":"2016-03-28T03:43:51Z","html_url":"https://github.com/auth0/blog/pull/234#discussion_r57542806","pull_request_url":"https://api.github.com/repos/auth0/blog/pulls/234","_links":{"self":{"href":"https://api.github.com/repos/auth0/blog/pulls/comments/57542806"},"html":{"href":"https://github.com/auth0/blog/pull/234#discussion_r57542806"},"pull_request":{"href":"https://api.github.com/repos/auth0/blog/pulls/234"}}},"pull_request":{"url":"https://api.github.com/repos/auth0/blog/pulls/234","id":64111463,"html_url":"https://github.com/auth0/blog/pull/234","diff_url":"https://github.com/auth0/blog/pull/234.diff","patch_url":"https://github.com/auth0/blog/pull/234.patch","issue_url":"https://api.github.com/repos/auth0/blog/issues/234","number":234,"state":"open","locked":false,"title":"Build a Cross-Platform Mobile App with C# and Xamarin Blog Post","user":{"login":"kukicadnan","id":1770570,"avatar_url":"https://avatars.githubusercontent.com/u/1770570?v=3","gravatar_id":"","url":"https://api.github.com/users/kukicadnan","html_url":"https://github.com/kukicadnan","followers_url":"https://api.github.com/users/kukicadnan/followers","following_url":"https://api.github.com/users/kukicadnan/following{/other_user}","gists_url":"https://api.github.com/users/kukicadnan/gists{/gist_id}","starred_url":"https://api.github.com/users/kukicadnan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kukicadnan/subscriptions","organizations_url":"https://api.github.com/users/kukicadnan/orgs","repos_url":"https://api.github.com/users/kukicadnan/repos","events_url":"https://api.github.com/users/kukicadnan/events{/privacy}","received_events_url":"https://api.github.com/users/kukicadnan/received_events","type":"User","site_admin":false},"body":"Content is too long to capture screenshot.","created_at":"2016-03-24T22:59:17Z","updated_at":"2016-03-28T03:43:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e0e300cca3b9483e3f99413e041ea53bc11b4eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/auth0/blog/pulls/234/commits","review_comments_url":"https://api.github.com/repos/auth0/blog/pulls/234/comments","review_comment_url":"https://api.github.com/repos/auth0/blog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/auth0/blog/issues/234/comments","statuses_url":"https://api.github.com/repos/auth0/blog/statuses/cab132682ead3852ddd920e17cdaa7cf2f8a5755","head":{"label":"auth0:build-app-with-xamarin-post","ref":"build-app-with-xamarin-post","sha":"cab132682ead3852ddd920e17cdaa7cf2f8a5755","user":{"login":"auth0","id":2824157,"avatar_url":"https://avatars.githubusercontent.com/u/2824157?v=3","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"repo":{"id":7830124,"name":"blog","full_name":"auth0/blog","owner":{"login":"auth0","id":2824157,"avatar_url":"https://avatars.githubusercontent.com/u/2824157?v=3","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/auth0/blog","description":"auth0 blog","fork":false,"url":"https://api.github.com/repos/auth0/blog","forks_url":"https://api.github.com/repos/auth0/blog/forks","keys_url":"https://api.github.com/repos/auth0/blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/auth0/blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/auth0/blog/teams","hooks_url":"https://api.github.com/repos/auth0/blog/hooks","issue_events_url":"https://api.github.com/repos/auth0/blog/issues/events{/number}","events_url":"https://api.github.com/repos/auth0/blog/events","assignees_url":"https://api.github.com/repos/auth0/blog/assignees{/user}","branches_url":"https://api.github.com/repos/auth0/blog/branches{/branch}","tags_url":"https://api.github.com/repos/auth0/blog/tags","blobs_url":"https://api.github.com/repos/auth0/blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/auth0/blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/auth0/blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/auth0/blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/auth0/blog/statuses/{sha}","languages_url":"https://api.github.com/repos/auth0/blog/languages","stargazers_url":"https://api.github.com/repos/auth0/blog/stargazers","contributors_url":"https://api.github.com/repos/auth0/blog/contributors","subscribers_url":"https://api.github.com/repos/auth0/blog/subscribers","subscription_url":"https://api.github.com/repos/auth0/blog/subscription","commits_url":"https://api.github.com/repos/auth0/blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/auth0/blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/auth0/blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/auth0/blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/auth0/blog/contents/{+path}","compare_url":"https://api.github.com/repos/auth0/blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/auth0/blog/merges","archive_url":"https://api.github.com/repos/auth0/blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/auth0/blog/downloads","issues_url":"https://api.github.com/repos/auth0/blog/issues{/number}","pulls_url":"https://api.github.com/repos/auth0/blog/pulls{/number}","milestones_url":"https://api.github.com/repos/auth0/blog/milestones{/number}","notifications_url":"https://api.github.com/repos/auth0/blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/auth0/blog/labels{/name}","releases_url":"https://api.github.com/repos/auth0/blog/releases{/id}","deployments_url":"https://api.github.com/repos/auth0/blog/deployments","created_at":"2013-01-25T22:57:37Z","updated_at":"2016-03-22T00:20:00Z","pushed_at":"2016-03-25T21:19:30Z","git_url":"git://github.com/auth0/blog.git","ssh_url":"git@github.com:auth0/blog.git","clone_url":"https://github.com/auth0/blog.git","svn_url":"https://github.com/auth0/blog","homepage":"https://auth0.com/blog","size":16456,"stargazers_count":14,"watchers_count":14,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":5,"forks":27,"open_issues":5,"watchers":14,"default_branch":"master"}},"base":{"label":"auth0:master","ref":"master","sha":"9ba87c69364160165d474dd93393c958b44f1035","user":{"login":"auth0","id":2824157,"avatar_url":"https://avatars.githubusercontent.com/u/2824157?v=3","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"repo":{"id":7830124,"name":"blog","full_name":"auth0/blog","owner":{"login":"auth0","id":2824157,"avatar_url":"https://avatars.githubusercontent.com/u/2824157?v=3","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/auth0/blog","description":"auth0 blog","fork":false,"url":"https://api.github.com/repos/auth0/blog","forks_url":"https://api.github.com/repos/auth0/blog/forks","keys_url":"https://api.github.com/repos/auth0/blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/auth0/blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/auth0/blog/teams","hooks_url":"https://api.github.com/repos/auth0/blog/hooks","issue_events_url":"https://api.github.com/repos/auth0/blog/issues/events{/number}","events_url":"https://api.github.com/repos/auth0/blog/events","assignees_url":"https://api.github.com/repos/auth0/blog/assignees{/user}","branches_url":"https://api.github.com/repos/auth0/blog/branches{/branch}","tags_url":"https://api.github.com/repos/auth0/blog/tags","blobs_url":"https://api.github.com/repos/auth0/blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/auth0/blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/auth0/blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/auth0/blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/auth0/blog/statuses/{sha}","languages_url":"https://api.github.com/repos/auth0/blog/languages","stargazers_url":"https://api.github.com/repos/auth0/blog/stargazers","contributors_url":"https://api.github.com/repos/auth0/blog/contributors","subscribers_url":"https://api.github.com/repos/auth0/blog/subscribers","subscription_url":"https://api.github.com/repos/auth0/blog/subscription","commits_url":"https://api.github.com/repos/auth0/blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/auth0/blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/auth0/blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/auth0/blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/auth0/blog/contents/{+path}","compare_url":"https://api.github.com/repos/auth0/blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/auth0/blog/merges","archive_url":"https://api.github.com/repos/auth0/blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/auth0/blog/downloads","issues_url":"https://api.github.com/repos/auth0/blog/issues{/number}","pulls_url":"https://api.github.com/repos/auth0/blog/pulls{/number}","milestones_url":"https://api.github.com/repos/auth0/blog/milestones{/number}","notifications_url":"https://api.github.com/repos/auth0/blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/auth0/blog/labels{/name}","releases_url":"https://api.github.com/repos/auth0/blog/releases{/id}","deployments_url":"https://api.github.com/repos/auth0/blog/deployments","created_at":"2013-01-25T22:57:37Z","updated_at":"2016-03-22T00:20:00Z","pushed_at":"2016-03-25T21:19:30Z","git_url":"git://github.com/auth0/blog.git","ssh_url":"git@github.com:auth0/blog.git","clone_url":"https://github.com/auth0/blog.git","svn_url":"https://github.com/auth0/blog","homepage":"https://auth0.com/blog","size":16456,"stargazers_count":14,"watchers_count":14,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":5,"forks":27,"open_issues":5,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/auth0/blog/pulls/234"},"html":{"href":"https://github.com/auth0/blog/pull/234"},"issue":{"href":"https://api.github.com/repos/auth0/blog/issues/234"},"comments":{"href":"https://api.github.com/repos/auth0/blog/issues/234/comments"},"review_comments":{"href":"https://api.github.com/repos/auth0/blog/pulls/234/comments"},"review_comment":{"href":"https://api.github.com/repos/auth0/blog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/auth0/blog/pulls/234/commits"},"statuses":{"href":"https://api.github.com/repos/auth0/blog/statuses/cab132682ead3852ddd920e17cdaa7cf2f8a5755"}}}}