{"id":2040,"date":"2015-12-16T01:01:42","date_gmt":"2015-12-16T01:01:41","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2040"},"modified":"2021-01-13T04:49:46","modified_gmt":"2021-01-13T12:49:46","slug":"build-mobile-apps-with-xamarin-and-couchbase-mobile","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/","title":{"rendered":"Build Mobile Apps with Xamarin and Couchbase Mobile"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10209\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/xamarin-logo-1024x429.png\" alt=\"xamarin-logo\" width=\"900\" height=\"377\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/xamarin-logo-1024x429.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/xamarin-logo-300x126.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/xamarin-logo-768x322.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/xamarin-logo-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/xamarin-logo-1320x554.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/xamarin-logo.png 1452w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><br \/>\n<span style=\"text-align: justify;\">Implementing a Xamarin solution with Couchbase Mobile is the perfect combination in creating a cross-platform mobile application in C# that has local persistence.\u00a0 This allows your content and data to not be ephemeral but better yet, your mobile application is not dependent on a network connection at all times.\u00a0 In this blog we will explore how to get started with <\/span><a style=\"text-align: justify;\" href=\"https:\/\/xamarin.com\/\">Xamarin<\/a><span style=\"text-align: justify;\"> and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.<\/span><\/p>\n<h3>New Xamarin Solution<\/h3>\n<p style=\"text-align: justify;\">Xamarin allows you to have the write once and run anywhere approach where it has a Native User Interface with Native performance.\u00a0 With the Xamarin Couchbase Lite NuGet package, you are able to share code across platforms using the C# and .NET Framework with full API support.\u00a0 Upon downloading and installing the iOS and Android components of Xamarin; when you open up Xamarin Studio, you will be presented with the Developer Center materials and some example solutions on the right hand side.\u00a0 You can try those at your leisure but we will be instead creating a new project and inserting Couchbase Mobile solution.\u00a0 Click &#8216;New Solution&#8217;<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10211 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/new_solution_xamarin.png\" alt=\"\" width=\"1500\" height=\"671\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/new_solution_xamarin.png 1500w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/new_solution_xamarin-300x134.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/new_solution_xamarin-1024x458.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/new_solution_xamarin-768x344.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/new_solution_xamarin-20x9.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/new_solution_xamarin-1320x590.png 1320w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><br \/>\nYou will now be presented with a Xamarin Solution page.\u00a0 For this blog we will focus on creating an Android Application and to do that we will..<\/p>\n<ol>\n<li style=\"text-align: justify;\">Choose &#8216;Android&#8217; in the C# dropdown and then &#8216;Android Application&#8217; as our project.<\/li>\n<li style=\"text-align: justify;\">Provide a name for your project like below where the name is \u2018CouchbaseMobile_Xamarin_App\u2019<\/li>\n<li style=\"text-align: justify;\">Click &#8216;OK&#8217;<\/li>\n<\/ol>\n<h3 style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10212\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/android_project.png\" alt=\"android_project\" width=\"1014\" height=\"604\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/android_project.png 1014w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/android_project-300x179.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/android_project-768x457.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/android_project-20x12.png 20w\" sizes=\"auto, (max-width: 1014px) 100vw, 1014px\" \/><br \/>\nAdd Couchbase NuGet Package<\/h3>\n<p style=\"text-align: justify;\">Now you have an empty Android Application project and we will be adding Couchbase Mobile as our next step.\u00a0 Xamarin now has first class support for NuGet which is built in and fully integrated.\u00a0 NuGet is a package management system for .NET that simplifies the process of using third party libraries within your mobile application such as Couchbase Lite.\u00a0 We will now download the latest Couchbase Lite.NET package from NuGet within Xamarin Studio.<\/p>\n<ol>\n<li style=\"text-align: justify;\">Right click on your project within the \u2018Solution\u2019 explorer section.\u00a0 I defined and created a project called \u2018CouchbaseMobile_Xamarin_App\u2019<\/li>\n<li style=\"text-align: justify;\">Select \u2018Add\u2019<\/li>\n<li style=\"text-align: justify;\">Select \u2018Add Packages<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10213 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/couchbase_nuget_package.png\" alt=\"Couchbase Nuget Package\" width=\"1500\" height=\"569\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_nuget_package.png 1500w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_nuget_package-300x114.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_nuget_package-1024x388.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_nuget_package-768x291.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_nuget_package-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_nuget_package-1320x501.png 1320w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/p>\n<p style=\"text-align: justify;\">With the \u2018Add Packages\u2019 dialog prompt now displayed like below, we will:<\/p>\n<ol>\n<li style=\"text-align: justify;\">Type in on the top right search field \u2018Couchbase Lite\u2019 and press enter to search for the package to install from within the Official NuGet Gallery<\/li>\n<li style=\"text-align: justify;\">Select the Couchbase Lite package from the list of return results<\/li>\n<li style=\"text-align: justify;\">Click on \u2018Add Package\u2019<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10214 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm.png\" alt=\"\" width=\"1622\" height=\"1070\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm.png 1622w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm-300x198.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm-1024x676.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm-768x507.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm-1536x1013.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/screen-shot-2015-12-10-at-3.58.45-pm-1320x871.png 1320w\" sizes=\"auto, (max-width: 1622px) 100vw, 1622px\" \/><\/li>\n<\/ol>\n<h3>Package Console &amp; Folder<\/h3>\n<p style=\"text-align: justify;\">Xamarin Studio now will add the packages and all of the dependencies for Couchbase Lite where at the time of writing we are using V1.1.2.0. \u00a0To verify and see the progress of the installation, click on the:<\/p>\n<ul>\n<li style=\"text-align: justify;\">\u2018Package Console\u2019 tab on the bottom right from within Xamarin Studio.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">You are able to see detailed information on the Couchbase.Lite package being installed.\u00a0 Where the Package Console will have..<\/p>\n<ol>\n<li style=\"text-align: justify;\">Adding Couchbase.Lite\u2026<\/li>\n<li style=\"text-align: justify;\">\u2026There will be other files that are added in between\u2026<\/li>\n<li style=\"text-align: justify;\">Finally you will be able to see \u2018Successfully added \u2018Couchbase.Lite \u2026\u2019 to your project<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10215\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/couchbase_install-1024x589.png\" alt=\"Couchbase Install\" width=\"900\" height=\"518\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_install-1024x589.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_install-300x173.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_install-768x442.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_install-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_install.png 1084w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><br \/>\nNext, over at the Solution explorer section over on the left of Xamarin Studio, you should see the following 4 packages now installed.\u00a0 Drop down the \u2018Packages\u2019 folder and you should see:<\/p>\n<ol>\n<li style=\"text-align: justify;\">Couchbase.Lite<\/li>\n<li style=\"text-align: justify;\">Newtonsoft.Json<\/li>\n<li style=\"text-align: justify;\">SQLitePCL.raw_basic<\/li>\n<li style=\"text-align: justify;\">SQLitePCL.ugly<\/li>\n<\/ol>\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10216\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/package_folder-1024x555.png\" alt=\"Package Folder\" width=\"900\" height=\"488\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/package_folder-1024x555.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/package_folder-300x163.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/package_folder-768x416.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/package_folder-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/package_folder.png 1155w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><br \/>\nUpdate Package<\/h3>\n<p style=\"text-align: justify;\">From the \u2018Packages\u2019 folder you can now easily update individual packages or all of them to the latest version or remove it from the project, by right clicking and selecting the appropriate menu item.<\/p>\n<ol>\n<li style=\"text-align: justify;\">Right click \u2018Packages\u2019 and click \u2018Update\u2019 to update all packages.<\/li>\n<li style=\"text-align: justify;\">Within Xamarin Studio you should see now \u2018Updating 4 packages in project..\u2019<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10217 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/update_package.png\" alt=\"Update Package\" width=\"1500\" height=\"334\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package.png 1500w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package-300x67.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package-1024x228.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package-768x171.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package-20x4.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package-1320x294.png 1320w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10218 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/update_package_01.png\" alt=\"Update Package 01\" width=\"1500\" height=\"387\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package_01.png 1500w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package_01-300x77.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package_01-1024x264.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package_01-768x198.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package_01-20x5.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/update_package_01-1320x341.png 1320w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/p>\n<h3>Android &amp; iOS Mobile Apps<\/h3>\n<p style=\"text-align: justify;\">We have successfully added Couchbase Lite into our Android project within Xamarin Studio.\u00a0 Now we will go into some starter code to create an app that has a local mobile database.\u00a0 The App that we are building is a Tasky tracking ToDo app that will have local persistance and what is cool is that we will only need to write our Database code once for both the iOS and Android solution as we are using Xamarin.\u00a0 One database and two different platform solutions.\u00a0 Below you can see both the Android version and the iOS UI.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10219\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/task_xamarin-1024x493.png\" alt=\"Task Xamarin\" width=\"900\" height=\"433\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_xamarin-1024x493.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_xamarin-300x144.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_xamarin-768x369.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_xamarin-20x10.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_xamarin.png 1058w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p style=\"text-align: justify;\">The beauty here is that with just one database code base, you are able to target both platforms as oppose to re-writing the database code again to be platform specific.\u00a0 Below the iOS version is running the same Couchbase Lite client side code base as the above Android version.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10220\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/task_ios_xamarin.png\" alt=\"Task iOS Xamarin\" width=\"832\" height=\"541\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_ios_xamarin.png 832w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_ios_xamarin-300x195.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_ios_xamarin-768x499.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_ios_xamarin-20x13.png 20w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/p>\n<h3>Shared Project<\/h3>\n<p style=\"text-align: justify;\">We will begin by bringing into our project the require frameworks to create our database.\u00a0 You would only need to create the Database once and you would be able to reference it across the various platforms that your app supports.<\/p>\n<ol>\n<li style=\"text-align: justify;\">Right click on your App Project within the Solution Explorer<\/li>\n<li style=\"text-align: justify;\">Select: Add<strong>&gt;<\/strong>Add New Project<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10221\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/shared_project.png\" alt=\"Shared Project\" width=\"748\" height=\"610\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project.png 748w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project-300x245.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project-20x16.png 20w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/p>\n<p style=\"text-align: justify;\">This will be our Database project class so name the project appropriately.\u00a0 For the example, I have named it &#8216;shared_Couchbase_Database&#8217;<\/p>\n<ol>\n<li style=\"text-align: justify;\">Select:\u00a0 C#<\/li>\n<li style=\"text-align: justify;\">Select:\u00a0 Shared Project options<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10222\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/shared_project_database-1024x618.png\" alt=\"Shared Project Database\" width=\"900\" height=\"543\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project_database-1024x618.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project_database-300x181.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project_database-768x463.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project_database-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/shared_project_database.png 1044w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3>Couchbase Starter Code<\/h3>\n<p style=\"text-align: justify;\">We will begin by bringing into our project the require frameworks to create our database.\u00a0 At this point, your application project should have now the app project and a project for your database.\u00a0 Ours is named \u2018shared_Couchbase_Database\u2019 and the generated file got renamed to be \u2018TaskManager\u2019.\u00a0 Open that file and we will add the following statement at the top to be able to use the Couchbase APIs:<\/p>\n<pre><code class=\"C#\">Using Couchbase.Lite;<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10223\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/couchbase_starter_code-1024x196.png\" alt=\"Couchbase Starter Code\" width=\"900\" height=\"172\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_starter_code-1024x196.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_starter_code-300x57.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_starter_code-768x147.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_starter_code-20x4.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_starter_code-1320x253.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbase_starter_code.png 1500w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3>Create Database<\/h3>\n<p style=\"text-align: justify;\">We will use the Couchbase Lite APIs to create a mobile database now.\u00a0 Currently, we are creating our database project to reference against the iOS and Android app projects.\u00a0 This will have our basic database operations.\u00a0 We will declare a Database variable and initialize the database within the constructor, while passing in a name which will be the name of our database to the \u2018GetDatabase\u2019 method.\u00a0 If it does not exist, a Database will be created.\u00a0 We have just created a database programmatically using the Couchbase Mobile APIs with the code below:<\/p>\n<pre><code class=\"C#\">db = Manager.SharedInstance.GetDatabase(\"name_db\");<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10224\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/create_database.png\" alt=\"Create database\" width=\"875\" height=\"254\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/create_database.png 875w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/create_database-300x87.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/create_database-768x223.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/create_database-20x6.png 20w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/p>\n<h3>CRUD Operations<\/h3>\n<p style=\"text-align: justify;\">Now we will be creating 4 basic operations for our mobile database.\u00a0 Create-Read-Update-Delete operations.\u00a0 We already saw before by creating a database, we also created a document database when we passed in a variable.\u00a0 Therefore the \u2018Create\u2019 has been done.\u00a0 Simple!<\/p>\n<h3>Retrieve Document<\/h3>\n<p style=\"text-align: justify;\">To get a particular Task that was created, we will create a \u2018GetTask\u2019 method and pass in a \u2018String id\u2019\u00a0 this id references a particular document that relates to the Task.<\/p>\n<p style=\"text-align: justify;\">The return type of the method is a type \u2018Task\u2019 and will be created later on.\u00a0 Each Task or Item that is created by the end user in the app will have a unique document ID in your database.\u00a0 So when a Task is created, a document is therefore created in junction.\u00a0 You can think of a Document as representing a Task here.\u00a0 Within the GetTask method, we will return back the associated document.\u00a0 From the particular document that is returned, we will call the \u2018UserProperties\u2019 API to get the properties of a document.\u00a0 The task that we return from the method will now have references to the document properties, eg. id, name, notes, done.<\/p>\n<p><!--cke_bookmark_2959S--><\/p>\n<pre><code class=\"C# language-cs\">var doc = db.GetDocument(id); <\/code><\/pre>\n<pre><code class=\"C# language-cs\">var props = doc.UserProperties;<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10225\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/retrieve_doc.png\" alt=\"Retrieve doc\" width=\"854\" height=\"570\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_doc.png 854w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_doc-300x200.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_doc-768x513.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_doc-400x267.png 400w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_doc-450x300.png 450w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_doc-20x13.png 20w\" sizes=\"auto, (max-width: 854px) 100vw, 854px\" \/><\/p>\n<h3>Retrieve Tasks<\/h3>\n<p style=\"text-align: justify;\">&#8216;CreateAllDocumentsQuery&#8217; method will create a Query that matches all Documents in the Database.<\/p>\n<pre><code class=\"C#\">var query = db.CreateAllDocumentsQuery ();<\/code><\/pre>\n<p style=\"text-align: justify;\">call the &#8216;Run()&#8217; method on the query variable to capture all the documents and from there you will iterate through these results to obtain the properties of each of the available documents.\u00a0 We will operate on a resultant row for a Coucbase Lite View, which is an index.<\/p>\n<p>Obtain the ID by calling on the &#8216;DocumentID&#8217; property on a particular row.<\/p>\n<pre><code class=\"bash\">ID = row.DocumentId,<\/code><\/pre>\n<p style=\"text-align: justify;\">With each \u2018task\u2019 object that has its property results initialized, we will store it in the Task List and return it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10226\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/retrieve_all_tasks-1024x449.png\" alt=\"Retrieve all tasks\" width=\"900\" height=\"395\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_all_tasks-1024x449.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_all_tasks-300x132.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_all_tasks-768x337.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_all_tasks-20x9.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/retrieve_all_tasks.png 1242w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3>Save Task<\/h3>\n<p style=\"text-align: justify;\">Call the &#8216;PutProperties&#8217; method to save new Task or documents, which will create and save a new Revision with the specified properties.<\/p>\n<p style=\"text-align: justify;\">The method takes a Dictionary as an input parameter so we will call the &#8216;ToDictionary&#8217; method on the Task item.<\/p>\n<pre><code class=\"C#\">doc.PutProperties (item.ToDictionary ());<\/code><\/pre>\n<p style=\"text-align: justify;\">If in the case the Task object&#8217;s ID value is not null, you will first retrieve the document in order to update the values of the keys. This is might look familiar as you have done this also in Step 5<\/p>\n<pre><code class=\"C#\">doc = db.GetDocument (item.ID);<\/code><\/pre>\n<p style=\"text-align: justify;\">Copy and paste in the code that will update the document with the new key-values from the Task object before the end of the &#8216;else&#8217; statement<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10227\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/save_task-1024x582.png\" alt=\"Save task\" width=\"900\" height=\"512\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/save_task-1024x582.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/save_task-300x170.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/save_task-768x436.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/save_task-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/save_task.png 1030w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3>Delete Task<\/h3>\n<p style=\"text-align: justify;\">The last operation is the &#8216;Delete&#8217; operation and to delete a document, you will first need to obtain the document or task object that you wish to delete from the database.\u00a0 Then you will call the &#8216;Delete&#8217; method on the document to remove it from the database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10228\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/delete_task.png\" alt=\"Delete task\" width=\"980\" height=\"257\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/delete_task.png 980w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/delete_task-300x79.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/delete_task-768x201.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/delete_task-20x5.png 20w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" \/><\/p>\n<p><code class=\"C#\">\u00a0<\/code><\/p>\n<p style=\"text-align: justify;\">Now that you have created a local databse with its operations, next we will create our &#8216;Task&#8217; file that will contain the properties that would represent a task that a user creates.<\/p>\n<h3 style=\"text-align: justify;\">Task Class<\/h3>\n<p style=\"text-align: justify;\">To create the Task class, we will right click the database project that was previously created and then select:<\/p>\n<ul>\n<li style=\"text-align: justify;\">Add<strong>&gt;<\/strong>New File &#8230;<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10229\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/task.png\" alt=\"Task\" width=\"772\" height=\"663\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task.png 772w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task-300x258.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task-768x660.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task-20x17.png 20w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<p style=\"text-align: justify;\">In the &#8216;New File&#8217; page, we will create an empty C# file called &#8216;Task&#8217; for our example here and then click &#8216;New&#8217;.\u00a0 This is our Task object in which we will be creating the generic properties associated in order to represent a task.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10230\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/task_empty.png\" alt=\"Task empty\" width=\"812\" height=\"615\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_empty.png 812w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_empty-300x227.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_empty-768x582.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_empty-20x15.png 20w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/p>\n<h3>Task Properties<\/h3>\n<p style=\"text-align: justify;\">Next, we are going to create our Task class which will hold all the properties of our Task object.\u00a0 Include the using statement:<\/p>\n<p style=\"text-align: justify;\">using System.Collections.Generic;<\/p>\n<p style=\"text-align: justify;\">We will create our Task class with the properties that represent a task.\u00a0 Recall that Couchbase Mobile is a NoSQL JSON database solution so we are storing our data as key-values.\u00a0 Below we are using a &#8216;Dictionary&#8217; type to represent the key-value data schema for &#8216;name&#8217;, &#8216;notes&#8217;, &#8216;done&#8217; keys that would reference the respective class variables of the same name.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10231\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/task_properties.png\" alt=\"Task properties\" width=\"990\" height=\"606\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_properties.png 990w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_properties-300x184.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_properties-768x470.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/task_properties-20x12.png 20w\" sizes=\"auto, (max-width: 990px) 100vw, 990px\" \/><\/p>\n<p style=\"text-align: justify;\">You now have a complete local database on your mobile app and can head over to the\u00a0 <code class=\"C#\"><a href=\"https:\/\/github.com\/WilliamHoang\/Tasky_Couchbase\">GitHub portal<\/a><\/code> to complete the Xamarin Mobile Task App.\u00a0 You already have a completed Mobile Database within your application and the next steps are building a cross platform Xamarin App that is specific to either iOS or Android UX.\u00a0 For Couchbase Lite, you can reference the <code class=\"C#\"><a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/develop\/training\/build-first-xamarin-android-app\/index.html\">Xamarin Android guide<\/a><\/code> or the <code class=\"C#\"><a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/training\/build-first-xamarin-ios-app\/index.html\">Xamarin iOS guide<\/a><\/code> to learn more on how to create offline mobile experieences with Sync and how to create document indexes using Views and then Querying documents for your mobile app.\u00a0 There is also the\u00a0<code class=\"C#\"><a href=\"https:\/\/github.com\/couchbaselabs\/mini-hacks\/tree\/master\/kitchen-sync\/xamarin\/project\">Couchbase Mobile Xamarin Mini-Hack<\/a><\/code> where you can learn how to build an offline mobile application and we will explore this further in the next Xamarin Couchbase blog!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Implementing a Xamarin solution with Couchbase Mobile is the perfect combination in creating a cross-platform mobile application in C# that has local persistence.\u00a0 This allows your content and data to not be ephemeral but better yet, your mobile application is [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1810],"tags":[],"ppma_author":[8983],"class_list":["post-2040","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-mobile"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Build Mobile Apps with Xamarin and Couchbase Mobile<\/title>\n<meta name=\"description\" content=\"Learn how to get started with Xamarin and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build Mobile Apps with Xamarin and Couchbase Mobile\" \/>\n<meta property=\"og:description\" content=\"Learn how to get started with Xamarin and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-16T01:01:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-13T12:49:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\"},\"author\":{\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\"},\"headline\":\"Build Mobile Apps with Xamarin and Couchbase Mobile\",\"datePublished\":\"2015-12-16T01:01:41+00:00\",\"dateModified\":\"2021-01-13T12:49:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\"},\"wordCount\":1760,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Mobile\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\",\"name\":\"Build Mobile Apps with Xamarin and Couchbase Mobile\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-12-16T01:01:41+00:00\",\"dateModified\":\"2021-01-13T12:49:46+00:00\",\"description\":\"Learn how to get started with Xamarin and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build Mobile Apps with Xamarin and Couchbase Mobile\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\",\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"caption\":\"William Hoang, Mobile Developer Advocate, Couchbase\"},\"description\":\"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Build Mobile Apps with Xamarin and Couchbase Mobile","description":"Learn how to get started with Xamarin and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/","og_locale":"en_US","og_type":"article","og_title":"Build Mobile Apps with Xamarin and Couchbase Mobile","og_description":"Learn how to get started with Xamarin and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.","og_url":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-12-16T01:01:41+00:00","article_modified_time":"2021-01-13T12:49:46+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"William Hoang, Mobile Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"William Hoang, Mobile Developer Advocate, Couchbase","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/"},"author":{"name":"William Hoang, Mobile Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32"},"headline":"Build Mobile Apps with Xamarin and Couchbase Mobile","datePublished":"2015-12-16T01:01:41+00:00","dateModified":"2021-01-13T12:49:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/"},"wordCount":1760,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Mobile"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/","url":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/","name":"Build Mobile Apps with Xamarin and Couchbase Mobile","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2015-12-16T01:01:41+00:00","dateModified":"2021-01-13T12:49:46+00:00","description":"Learn how to get started with Xamarin and begin to implement the Couchbase Lite components from the Couchbase Mobile stack to create a storage layer.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/build-mobile-apps-with-xamarin-and-couchbase-mobile\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Build Mobile Apps with Xamarin and Couchbase Mobile"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32","name":"William Hoang, Mobile Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5","url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","caption":"William Hoang, Mobile Developer Advocate, Couchbase"},"description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering","url":"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/"}]}},"authors":[{"term_id":8983,"user_id":30,"is_guest":0,"slug":"william-hoang","display_name":"William Hoang, Mobile Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","author_category":"","last_name":"Hoang","first_name":"William","job_title":"","user_url":"","description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering"}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2040"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2040\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2040"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}