{"id":2228,"date":"2016-04-18T22:29:30","date_gmt":"2016-04-18T22:29:30","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2228"},"modified":"2025-06-13T20:15:41","modified_gmt":"2025-06-14T03:15:41","slug":"couchbase-mobile-in-a-cross-platform-telerik-nativescript-app","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/","title":{"rendered":"Couchbase Mobile in a Cross Platform Telerik NativeScript App"},"content":{"rendered":"<p>From a personal level, I&#8217;m a huge fan of Telerik <a href=\"https:\/\/www.nativescript.org\">NativeScript<\/a>. It is a cross platform development framework for building <strong>native<\/strong> Android and iOS applications using a single codeset, that code set being JavaScript. I had to put emphasis on the native part because it is one of the only cross platform frameworks that does not use a web view for displaying content. This in turn creates an application that has incredible performance.<\/p>\n<p>Up until now there hasn&#8217;t been a good solution for storing data in a NativeScript app. That is until now!<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2016\/april\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/couchbase-nativescript-image.png\" \/><\/p>\n<p>With the help of Telerik and the NativeScript team, I was able to come up with a <a href=\"https:\/\/github.com\/couchbaselabs\/nativescript-couchbase\">Couchbase Lite plugin for NativeScript<\/a> that allows you to leverage the power of NoSQL in your mobile application. When paired with Couchbase Sync Gateway, data can be synchronized between devices and platforms.<\/p>\n<p>We&#8217;re going to see what it takes to get started with <a href=\"https:\/\/developer.couchbase.com\/mobile?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">Couchbase Mobile<\/a> in your NativeScript app.<\/p>\n<h2>The Requirements<\/h2>\n<p>There are a few requiements to make this possible.<\/p>\n<ul>\n<li>NativeScript 1.7+<\/li>\n<li>The Android SDK (if building Android apps)<\/li>\n<li>Xcode and a Mac (if building iOS apps)<\/li>\n<li>Couchbase Sync Gateway (for sync)<\/li>\n<\/ul>\n<p>You don&#8217;t need to build for both Android and iOS, but it certainly is convenient.<\/p>\n<h2>Creating a New NativeScript Project<\/h2>\n<p>We&#8217;re going to build a simple name list application that synchronizes between devices. To do this, execute the following from a Command Prompt (Windows) or Terminal (Mac and Linux):<\/p>\n<pre><code>\r\ntns create CouchbaseProject\r\ncd CouchbaseProject\r\ntns platform add ios\r\ntns platform add android\r\n<\/code><\/pre>\n<p>Remember, if you&#8217;re not using a Mac, you cannot add and build for the iOS platform. Going forward, the Command Prompt or Terminal should use <strong>CouchbaseProject<\/strong> as the working directory.<\/p>\n<h2>Including the Couchbase Lite SDK<\/h2>\n<p>With the project created it is time to include the Couchbase Lite plugin for use. From the Terminal or Command Prompt, execute the following:<\/p>\n<pre><code>\r\ntns plugin add nativescript-couchbase\r\n<\/code><\/pre>\n<p>This will include the plugin for whatever platforms that have been added to the project.<\/p>\n<h2>Developing the Application<\/h2>\n<p>With the project created we need to create a few files and directories. Go ahead and add the following:<\/p>\n<pre><code>\r\nmkdir app\/views\r\nmkdir app\/views\/list\r\nmkdir app\/views\/create\r\ntouch app\/views\/list\/list.js\r\ntouch app\/views\/list\/list.xml\r\ntouch app\/views\/create\/create.js\r\ntouch app\/views\/create\/create.xml\r\n<\/code><\/pre>\n<p>The above files is where we are going to spend most of our time, but before we jump in, open the project&#8217;s <strong>app\/app.js<\/strong> file and switch out the appropriate line with the following:<\/p>\n<pre><code>\r\napplication.start({ moduleName: \"views\/list\/list\" });\r\n<\/code><\/pre>\n<p>This tells the NativeScript application that the <strong>list<\/strong> view will be our first view.<\/p>\n<h3>Creating the Application Logic<\/h3>\n<p>The application logic files are the JavaScript files. One file will drive the logic behind our list view and the other will drive the logic behind our name creation form. Starting with the list logic, open the project&#8217;s <strong>app\/views\/list\/list.js<\/strong> file and include the following code:<\/p>\n<pre><code>\r\nvar couchbaseModule = require(\"nativescript-couchbase\");\r\nvar observableArrayModule = require(\"data\/observable-array\");\r\nvar frameModule = require(\"ui\/frame\");\r\n\r\nvar database;\r\nvar personList;\r\n\r\nfunction pageLoaded(args) {\r\n    var page = args.object;\r\n\r\n    personList = new observableArrayModule.ObservableArray([]);\r\n    database = new couchbaseModule.Couchbase(\"test-database\");\r\n\r\n    database.createView(\"people\", \"1\", function(document, emitter) {\r\n        emitter.emit(JSON.parse(document)._id, document);\r\n    });\r\n\r\n    refresh();\r\n    page.bindingContext = {personList: personList};\r\n}\r\n\r\nfunction refresh() {\r\n    personList.splice(0);\r\n\r\n    var rows = database.executeQuery(\"people\");\r\n\r\n    for(var i in rows) {\r\n          if(rows.hasOwnProperty(i)) {\r\n              personList.push(JSON.parse(rows[i]));\r\n          }\r\n    }\r\n}\r\n\r\nfunction create() {\r\n    frameModule.topmost().navigate({moduleName: \"views\/create\/create\"});\r\n}\r\n\r\nexports.pageLoaded = pageLoaded;\r\nexports.refresh = refresh;\r\nexports.create = create;\r\n<\/code><\/pre>\n<p>There is a lot happening in the above logic file so we&#8217;re going to break it down. First thing we&#8217;re doing is including a few JavaScript libraries:<\/p>\n<pre><code>\r\nvar couchbaseModule = require(\"nativescript-couchbase\");\r\nvar observableArrayModule = require(\"data\/observable-array\");\r\nvar frameModule = require(\"ui\/frame\");\r\n<\/code><\/pre>\n<p>The plugin that was installed must first be imported. All data read from the database will be stored in an observable array. This is so we can subscribe to data changes and bind the data to the UI. Finally the frame is imported so we can navigate to other pages.<\/p>\n<p>To open a particular Couchbase NoSQL database we would execute the following command:<\/p>\n<pre><code>\r\ndatabase = new couchbaseModule.Couchbase(\"test-database\");\r\n<\/code><\/pre>\n<p>The above command will open the database if it exists or it will create and open the database if it does not exist.<\/p>\n<pre><code>\r\ndatabase.createView(\"people\", \"1\", function(document, emitter) {\r\n    emitter.emit(JSON.parse(document)._id, document);\r\n});\r\n<\/code><\/pre>\n<p>If this is your first time working with NoSQL, the above snippet might look very foreign. It is the creation of a MapReduce view. Instead of writing a SQL statement as seen in SQLite, we&#8217;re creating MapReduce views that we can query for data. The above view will return a key-value pair of all documents where the key is the document id and the value is the document itself. This view is going to be called <strong>people<\/strong>.<\/p>\n<p>With the view in place, it needs to be queried. This is done through the <strong>refresh<\/strong> function. Before getting to the refresh function, notice the final line of the <strong>pageLoaded<\/strong> function. This shows that we&#8217;ll be binding the <strong>personList<\/strong> data to our UI. Let&#8217;s look at that <strong>refresh<\/strong> function:<\/p>\n<pre><code>\r\nfunction refresh() {\r\n    personList.splice(0);\r\n\r\n    var rows = database.executeQuery(\"people\");\r\n\r\n    for(var i in rows) {\r\n          if(rows.hasOwnProperty(i)) {\r\n              personList.push(JSON.parse(rows[i]));\r\n          }\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Every time we query the list will be reset and re-populated. The view will only be queried when the page loads. We&#8217;ll see why further down in this tutorial.<\/p>\n<p>With the <strong>app\/views\/list\/list.js<\/strong> file out of the way we can focus on the logic file behind the creation form. Open the project&#8217;s <strong>app\/views\/create\/create.js<\/strong> file and include the following code:<\/p>\n<pre><code>\r\nvar couchbaseModule = require(\"nativescript-couchbase\");\r\nvar observableArrayModule = require(\"data\/observable-array\");\r\nvar frameModule = require(\"ui\/frame\");\r\n\r\nvar database;\r\nvar tfFirstName;\r\nvar tfLastName;\r\n\r\nfunction pageLoaded(args) {\r\n    var page = args.object;\r\n\r\n    personList = new observableArrayModule.ObservableArray([]);\r\n    database = new couchbaseModule.Couchbase(\"test-database\");\r\n\r\n    tfFirstName = page.getViewById(\"firstname\");\r\n    tfLastName = page.getViewById(\"lastname\");\r\n\r\n    page.bindingContext = {};\r\n}\r\n\r\nfunction save() {\r\n    database.createDocument({\r\n        \"firstname\": tfFirstName.text,\r\n        \"lastname\": tfLastName.text\r\n    });\r\n    frameModule.goBack();\r\n}\r\n\r\nexports.pageLoaded = pageLoaded;\r\nexports.save = save;\r\n<\/code><\/pre>\n<p>This file is a lot more lightweight in comparison to the last. Essentially we&#8217;re capturing the form elements that we&#8217;ve yet to create. When we call the <strong>save<\/strong> function it will take the values in the form fields and create the document in Couchbase. No SQL schemas or nonsense to slow you down when it comes to development. One of the major benefits to using NoSQL.<\/p>\n<p>The logic is now complete, for now, and we can move onto the UI.<\/p>\n<h3>Designing a Cross Platform UI<\/h3>\n<p>The UI code is short and sweet. Remember, our list will only contain information about the users we add. Open the project&#8217;s <strong>app\/views\/list\/list.xml<\/strong> file and include the following code:<\/p>\n<pre><code>\r\n\r\n    \r\n  \r\n   \r\n    \r\n   \r\n  \r\n \r\n    \r\n        \r\n            \r\n                <label><\/label>\r\n            \r\n        \r\n    \r\n\r\n<\/code><\/pre>\n<p>When the page loads, it calls the <strong>pageLoaded<\/strong> function. The action bar has a single button for navigating to the <strong>create<\/strong> page. Finally the list view will iterate over the <strong>personList<\/strong> observable array that was created in the logic file.<\/p>\n<p>When it comes to the create form, there is similarly a small amount of XML code to be included. Open the project&#8217;s <strong>app\/views\/create\/create.xml<\/strong> file and include the following code:<\/p>\n<pre><code>\r\n\r\n    \r\n  \r\n   \r\n    \r\n   \r\n  \r\n \r\n    \r\n        <label><\/label>\r\n        \r\n        <label><\/label>\r\n        \r\n    \r\n\r\n<\/code><\/pre>\n<p>Again the <strong>pageLoaded<\/strong> is called on page load. The action bar has a single button for saving the Couchbase data, and the form contains data that is read via the logic file that we previously created.<\/p>\n<p>We should have a fully functional app that uses Couchbase for storing data. However, as of right now this application is offline only. Data is not being synchronized.<\/p>\n<h2>Including Couchbase Sync Gateway for Data Replication<\/h2>\n<p>To synchronize the application data between Couchbase Server and other devices, the <a href=\"https:\/\/www.couchbase.com\/nosql-databases\/downloads\/\">Couchbase Sync Gateway<\/a> must be included along with a special configuration file. To keep things simple here, we are not going to go in depth when it comes to a Sync Gateway configuration file. Something like this will suffice:<\/p>\n<pre><code>\r\n{\r\n    \"log\":[\"CRUD+\", \"REST+\", \"Changes+\", \"Attach+\"],\r\n    \"databases\": {\r\n        \"test-database\": {\r\n            \"server\":\"walrus:\",\r\n            \"sync\":`\r\n                function (doc) {\r\n                    channel (doc.channels);\r\n                }\r\n            `,\r\n            \"users\": {\r\n                \"GUEST\": {\r\n                    \"disabled\": false,\r\n                    \"admin_channels\": [\"*\"]\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>What matters to us for this tutorial is the code that communicates with the Sync Gateway via our application. We&#8217;re now going to revisit the <strong>app\/views\/list\/list.js<\/strong> file and include some code in the <strong>pageLoaded<\/strong> function. Open the file and include the following:<\/p>\n<pre><code>\r\nvar push = database.createPushReplication(\"https:\/\/localhost:4984\/test-database\");\r\nvar pull = database.createPullReplication(\"https:\/\/localhost:4984\/test-database\");\r\n\r\npush.setContinuous(true);\r\npull.setContinuous(true);\r\n\r\npush.start();\r\npull.start();\r\n<\/code><\/pre>\n<p>In the above we are telling our application that we are going to push and pull from the same Sync Gateway that is being run locally. Replications are going to happen continuously in both directions. Then we finally start the process.<\/p>\n<p>With data being uploaded and downloaded we need a way to update the UI when necessary. Previously I mentioned we were only querying one time when the page loads. This is because we&#8217;re actually going to use a listener to listen for changes. It is more efficient than continously querying for potentially massive amounts of data. Inside your <strong>app\/views\/list\/list.js<\/strong> file, within the <strong>pageLoaded<\/strong> function, include the following code:<\/p>\n<pre><code>\r\ndatabase.addDatabaseChangeListener(function(changes) {\r\n    var changeIndex;\r\n    for(var i = 0; i &lt; changes.length; i++) {\r\n        var documentId;\r\n\r\n        documentId = changes[i].getDocumentId();\r\n        changeIndex = indexOfObjectId(documentId, personList);\r\n        var document = database.getDocument(documentId);\r\n\r\n        if(changeIndex == -1) {\r\n            personList.push(document);\r\n        } else {\r\n            personList.setItem(changeIndex, document);\r\n        }\r\n    }\r\n});\r\n<\/code><\/pre>\n<p>The goal here is to pick up a change, see if that document already exists in the list, if it doesn&#8217;t, add it, otherwise, change it. The function for finding where a document exists in the list can be seen below:<\/p>\n<pre><code>\r\nfunction indexOfObjectId(needle, haystack) {\r\n    for(var i = 0; i &lt; haystack.length; i++) {\r\n        if(haystack.getItem(i) != undefined &amp;&amp; haystack.getItem(i).hasOwnProperty(\"_id\")) {\r\n            if(haystack.getItem(i)._id == needle) {\r\n                return i;\r\n            }\r\n        }\r\n    }\r\n    return -1;\r\n}\r\n<\/code><\/pre>\n<p>Maybe not the most efficient way to update a list view, but it works for this example.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2016\/april\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/couchbase-nativescript-animation.gif\" \/><\/p>\n<p>At this point if you run the Sync Gateway and your application, it should synchronize the data.<\/p>\n<h2>Conclusion<\/h2>\n<p>You just saw how to create a simple cross platform, <strong>native<\/strong>, Android and iOS application that syncs using NativeScript and the Couchbase Lite plugin. Further information about the plugin can be seen on the project&#8217;s <a href=\"https:\/\/github.com\/couchbaselabs\/nativescript-couchbase\">GitHub<\/a> page. More on Couchbase Mobile can be seen in the <a href=\"https:\/\/developer.couchbase.com\/?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">Couchbase Developer Portal<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From a personal level, I&#8217;m a huge fan of Telerik NativeScript. It is a cross platform development framework for building native Android and iOS applications using a single codeset, that code set being JavaScript. I had to put emphasis on [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,1810,9327],"tags":[1577,1543,1589],"ppma_author":[9032],"class_list":["post-2228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-couchbase-mobile","category-javascript","tag-cross-platform","tag-javascript","tag-nativescript"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Couchbase Mobile in a Cross platform Telerik NativeScript App<\/title>\n<meta name=\"description\" content=\"Learn how to create a simple cross platform, native, Android and iOS application. It syncs using NativeScript and the Couchbase Lite plugin.\" \/>\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\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase Mobile in a Cross Platform Telerik NativeScript App\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a simple cross platform, native, Android and iOS application. It syncs using NativeScript and the Couchbase Lite plugin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/thepolyglotdeveloper\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-18T22:29:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:15:41+00:00\" \/>\n<meta name=\"author\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nraboy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Couchbase Mobile in a Cross Platform Telerik NativeScript App\",\"datePublished\":\"2016-04-18T22:29:30+00:00\",\"dateModified\":\"2025-06-14T03:15:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\"},\"wordCount\":1372,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"cross platform\",\"javascript\",\"nativescript\"],\"articleSection\":[\"Application Design\",\"Couchbase Mobile\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\",\"name\":\"Couchbase Mobile in a Cross platform Telerik NativeScript App\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2016-04-18T22:29:30+00:00\",\"dateModified\":\"2025-06-14T03:15:41+00:00\",\"description\":\"Learn how to create a simple cross platform, native, Android and iOS application. It syncs using NativeScript and the Couchbase Lite plugin.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#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\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase Mobile in a Cross Platform Telerik NativeScript App\"}]},{\"@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\/bb545ebe83bb2d12f91095811d0a72e1\",\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"caption\":\"Nic Raboy, Developer Advocate, Couchbase\"},\"description\":\"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.\",\"sameAs\":[\"https:\/\/www.thepolyglotdeveloper.com\",\"https:\/\/www.facebook.com\/thepolyglotdeveloper\",\"https:\/\/x.com\/nraboy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/nic-raboy-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Couchbase Mobile in a Cross platform Telerik NativeScript App","description":"Learn how to create a simple cross platform, native, Android and iOS application. It syncs using NativeScript and the Couchbase Lite plugin.","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\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/","og_locale":"en_US","og_type":"article","og_title":"Couchbase Mobile in a Cross Platform Telerik NativeScript App","og_description":"Learn how to create a simple cross platform, native, Android and iOS application. It syncs using NativeScript and the Couchbase Lite plugin.","og_url":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2016-04-18T22:29:30+00:00","article_modified_time":"2025-06-14T03:15:41+00:00","author":"Nic Raboy, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@nraboy","twitter_misc":{"Written by":"Nic Raboy, Developer Advocate, Couchbase","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Couchbase Mobile in a Cross Platform Telerik NativeScript App","datePublished":"2016-04-18T22:29:30+00:00","dateModified":"2025-06-14T03:15:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/"},"wordCount":1372,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["cross platform","javascript","nativescript"],"articleSection":["Application Design","Couchbase Mobile","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/","url":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/","name":"Couchbase Mobile in a Cross platform Telerik NativeScript App","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2016-04-18T22:29:30+00:00","dateModified":"2025-06-14T03:15:41+00:00","description":"Learn how to create a simple cross platform, native, Android and iOS application. It syncs using NativeScript and the Couchbase Lite plugin.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#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\/couchbase-mobile-in-a-cross-platform-telerik-nativescript-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Couchbase Mobile in a Cross Platform Telerik NativeScript App"}]},{"@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\/bb545ebe83bb2d12f91095811d0a72e1","name":"Nic Raboy, Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354","url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","caption":"Nic Raboy, Developer Advocate, Couchbase"},"description":"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/author\/nic-raboy-2\/"}]}},"authors":[{"term_id":9032,"user_id":63,"is_guest":0,"slug":"nic-raboy-2","display_name":"Nic Raboy, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","author_category":"","last_name":"Raboy","first_name":"Nic","job_title":"","user_url":"https:\/\/www.thepolyglotdeveloper.com","description":"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2228","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2228"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2228\/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=2228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2228"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}