<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
	<channel>
		<title>Author at Infinum</title>
		<atom:link href="https://infinum.com/blog/author/ana-baotic/feed/" rel="self" type="application/rss+xml" />
		<link></link>
		<description>Building digital products</description>
		<lastBuildDate>Fri, 03 Apr 2026 12:58:20 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>

					<item>
				<image>
					<url>7919https://infinum.com/uploads/2017/02/android-fingerprint-security-0.webp</url>
				</image>
				<title>Android Fingerprint Security</title>
				<link>https://infinum.com/blog/android-fingerprint-security/</link>
				<pubDate>Thu, 07 Jul 2016 14:40:00 +0000</pubDate>
				<dc:creator>Ana Baotic</dc:creator>
				<guid isPermaLink="false">https://infinum.com/the-capsized-eight/android-fingerprint-security/</guid>
				<description>
					<![CDATA[<p>Security has always been a crucial part of mobile development, and getting it right is no small feat. </p>
<p>The post <a href="https://infinum.com/blog/android-fingerprint-security/">Android Fingerprint Security</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</description>
				<content:encoded>
					<![CDATA[<div
	class="wrapper"
	data-id="es-212"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-92">
	</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-95"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-93">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-94'
	>
	Security has always been a crucial part of mobile development, and getting it right is no small feat. Smartphones started out using 4-digit PIN codes that took <strong>10,000</strong> tries at most to crack. Then came the lock pattern that raised the bar to astonishing <strong>389,112</strong> distinct patterns, although basic <a href="http://arstechnica.com/security/2015/08/new-data-uncovers-the-surprising-predictability-of-android-lock-patterns/" target="_blank" rel="noreferrer noopener">human nature</a> drastically lowers this number.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-98"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-96"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-stretch" data-id="es-97">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2017/02/android-fingerprint-security-1.webp"
					class="image__img block-media__image-img"
					alt=""
										height="323"
															width="1000"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-101"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-99">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-100'
	>
	Unlike PINs and lock patterns, fingerprint authentication is light-years ahead. One&#8217;s fingerprint is truly unique and cannot be guessed. This technology is becoming increasingly popular on consumer devices, and with Marshmallow it&#8217;s easier than ever to implement it in your app.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-104"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-102">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-103'
	>
	Then</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-107"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-105">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-106'
	>
	Apart from iOS Touch ID which <a href="https://infinum.com/news/mobile-banking-at-your-fingerprints/">we already wrote about</a>, early implementations of fingerprint scanning on Android were not adequate. Every <a href="http://www.digitaltrends.com/mobile/hackers-can-steal-fingerprints-android-phones/">vendor</a> had their unique approach to security and implementation of the process and, most importantly, to how the user’s private data is stored.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-110"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-108">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-109'
	>
	Now</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-113"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-111">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-112'
	>
	With Marshmallow came the long awaited native support for fingerprint authentication via a standard API. Android developers were finally allowed to implement fingerprint-based authentication for unlocking devices, Play Store and Android Pay purchases, as well as providing custom authentication in security-heavy applications like mobile banking.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-116"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-114">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-115'
	>
	First made available on the <strong>Nexus 5X</strong> and <strong>Nexus 6P</strong>, Google introduced the fast and secure <a href="http://www.androidcentral.com/nexus-imprint">Nexus Imprint</a> fingerprint sensor which also brought along the first implementation of the Android 6.0 Marshmallow fingerprint sensor API. Fingerprints are recognized in less than 600 milliseconds, providing fast and comfortable user experience.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-119"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-117">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-118'
	>
	Fingerprint storage security</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-122"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-120">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-121'
	>
	Most storage strategies on Android are insecure, especially when you consider the possibility of root access. But Google has made a noteworthy step in the right direction by moving all print data manipulation to the <strong>Trusted Execution Environment</strong> <a href="https://en.wikipedia.org/wiki/Trusted_execution_environment">(TEE)</a> and providing strict guidelines for fingerprint data storage that manufacturers must follow.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-125"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-123">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-124'
	>
	TEE</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-128"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-126">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-127'
	>
	TEE is a secure area of the smartphone’s main processor. It guarantees <strong>confidentiality</strong> and <strong>integrity</strong> of the code and data loaded inside. This separation enables security and protection from hacks, malware and root access.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-131"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-129"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-stretch" data-id="es-130">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2017/02/android-fingerprint-security-2.webp"
					class="image__img block-media__image-img"
					alt=""
										height="1000"
															width="906"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-134"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="lists" data-id="es-132">
	<ul	class='typography typography--size-16-text-roman js-typography lists__typography'
	data-id='es-133'
	>
	<li>All fingerprint data manipulation is performed within TEE</li><li>All fingerprint data must be secured within sensor hardware or trusted memory so that images of your fingerprint are inaccessible</li><li>Fingerprint data can be stored on the file system only in encrypted form, regardless of whether the file system itself is encrypted or not</li><li>Removal of the user must result in removal of the user&#8217;s existing fingerprint data</li><li>Root access must not compromise fingerprint data</li></ul></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-137"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-135">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-136'
	>
	Fingerprint templates</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-140"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-138">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-139'
	>
	Fingerprint templates are the processed versions of raw fingerprint data.<br>In order to comply with guidelines they must be <strong>cryptographically authenticated</strong>. This means they have to be signed with a private, device-specific key and enough additional data (an absolute file system path, finger ID and group) that will unequivocally define their binding relationship. As a result, these templates are rendered useless if copied to another device or another user tries to use them.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-143"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-141">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-142'
	>
	Finally, fingerprint data is not backed up to the user’s computer or Google’s servers. It is not synced, shared or used by any other app on your device nor does it ever leave your device. The only information apps receive is whether a fingerprint has been <strong>verified or not</strong>. This also means the user has to set up fingerprint authentication on each new device.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-146"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-144">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-145'
	>
	Sounds good, how do I implement it?</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-149"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-147">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-148'
	>
	Fingerprint authentication in nothing more than data encryption. It involves a key, a cipher that performs encryption, and a fingerprint manager that handles the whole process. From a developer’s standpoint, the process is somewhat extensive but it consists of relatively simple steps.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-153"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-150">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-151'
	>
	1</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-152'
	>
	Request fingerprint authentication permission within the project&#8217;s <code>AndroidManifest</code> file.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-157"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-154">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-155'
	>
	2</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-156'
	>
	Enable any lock screen security mechanism (PIN, pattern or password).</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-161"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-158">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-159'
	>
	3</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-160'
	>
	Register at least one fingerprint on the device.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-165"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-162">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-163'
	>
	4</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-164'
	>
	Create an instance of the <code>FingerprintManager</code>.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-169"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-166">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-167'
	>
	5</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-168'
	>
	Use a <code>Keystore</code> instance to gain access to the Android Keystore container.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-173"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-170">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-171'
	>
	6</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-172'
	>
	Generate an encryption key using the <code>KeyGenerator</code> class and store it in the Keystore container.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-177"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-174">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-175'
	>
	7</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-176'
	>
	Initialise an instance of the <code>Cipher</code> class using the previously generated encryption key.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-181"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-178">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-179'
	>
	8</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-180'
	>
	Use the <code>Cipher</code> instance to create a <code>CryptoObject</code> and assign it to the instantiated <code>FingerprintManager</code>.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-185"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-182">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-183'
	>
	9</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-184'
	>
	Call the <code>authenticate()</code> method of the <code>FingerprintManager</code> instance.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-189"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-186">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-187'
	>
	10</p>	<div class="bullet__content">
		<p	class='typography typography--size-20-text-roman js-typography bullet__paragraph'
	data-id='es-188'
	>
	Handle callbacks on completion of a successful authentication, providing access to protected content or functionality.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-192"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-190">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-191'
	>
	Google has supplied a comprehensive <a href="https://github.com/googlesamples/android-FingerprintDialog">sample</a> for fingerprint authentication, and there are several <a href="http://www.techotopia.com/index.php/An_Android_Fingerprint_Authentication_Tutorial">tutorials</a> available online that can get you on your way.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-195"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-193">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-194'
	>
	Android’s fingerprint authentication and backing implementation have been designed and executed really well. Using it as a <a href="http://searchsecurity.techtarget.com/definition/possession-factor"><strong>possession element</strong></a> of any form of multi-factor authentication is more than enough to provide you with a fast, reliable and secure authentication experience.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-198"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-196">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-197'
	>
	You can hear us talk about fingerprint security and best practices in app security at the <a href="http://360andev.com/"><strong>360andev</strong></a> conference in Denver, CO.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-201"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-199">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-200'
	>
	So where’s the catch?</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-204"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-202"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-stretch" data-id="es-203">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2017/02/android-fingerprint-security-3.webp"
					class="image__img block-media__image-img"
					alt=""
										height="633"
															width="1000"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-207"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-205">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-206'
	>
	There is only one and it&#8217;s basically the same flaw all other methods have; fingerprint authentication has a single point of failure. As attractive as using your fingers for unlocking your device is, you leave them&nbsp;<strong>everywhere</strong>. A prospective attacker can lift your fingerprint&nbsp;<a href="https://www.youtube.com/watch?v=8Wsc8fnf-aM" target="_blank" rel="noreferrer noopener">without much hassle</a>, and then use it to get control of your device and apps.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-210"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-208">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-209'
	>
	Unfortunately, unlike passwords, your fingerprints are something you obviously cannot change.</p></div>	</div>
</div>
</div>		</div>
	</div><p>The post <a href="https://infinum.com/blog/android-fingerprint-security/">Android Fingerprint Security</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</content:encoded>
			</item>
					<item>
				<image>
					<url>8061https://infinum.com/uploads/2014/07/server-client-syncing-for-mobile-apps-using-couchbase-mobile-0.webp</url>
				</image>
				<title>Simple Server-Client Syncing for Mobile Apps Using Couchbase Mobile</title>
				<link>https://infinum.com/blog/server-client-syncing-for-mobile-apps-using-couchbase-mobile/</link>
				<pubDate>Thu, 17 Jul 2014 09:20:00 +0000</pubDate>
				<dc:creator>Ana Baotic</dc:creator>
				<guid isPermaLink="false">https://infinum.com/the-capsized-eight/server-client-syncing-for-mobile-apps-using-couchbase-mobile/</guid>
				<description>
					<![CDATA[<p>If you&#8217;re developing a content rich application that synchronizes data from server to smartphone and needs to work offline, this is the article for you.</p>
<p>The post <a href="https://infinum.com/blog/server-client-syncing-for-mobile-apps-using-couchbase-mobile/">Simple Server-Client Syncing for Mobile Apps Using Couchbase Mobile</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</description>
				<content:encoded>
					<![CDATA[<div
	class="wrapper"
	data-id="es-299"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-213">
	</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-216"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-214">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-215'
	>
	If you’re developing a content rich application that synchronizes data from server to smartphone and needs to work offline, this is the article for you.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-219"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-217">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-218'
	>
	Every once in a while, you end up working on a project that throws you out of your comfort zone and requires some heavy duty learning.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-222"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-220">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-221'
	>
	For me, it was a seemingly simple project that required things like data replication and high availability, things I vaguely remember from my college days.<br>After some exploring, I came across <a href="http://www.couchbase.com/mobile">Couchbase Mobile</a>, a framework that offers support for mobile app development and covers all of the requirements.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-225"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-223">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-224'
	>
	Couchbase Mobile has two major parts:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-228"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="lists" data-id="es-226">
	<ul	class='typography typography--size-16-text-roman js-typography lists__typography'
	data-id='es-227'
	>
	<li><strong>Couchbase Lite</strong> – an embedded, schemaless, JSON database</li><li><strong>Sync Gateway</strong> – a mechanism to sync data to and from the server</li></ul></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-231"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-229"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-stretch" data-id="es-230">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2014/07/server-client-syncing-for-mobile-apps-using-couchbase-mobile-1.webp"
					class="image__img block-media__image-img"
					alt=""
										height="394"
															width="700"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-234"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-232">
	<h3	class='typography typography--size-36-text js-typography block-heading__heading'
	data-id='es-233'
	>
	NOSQL</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-237"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-235">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-236'
	>
	Couchbase Lite is a <a href="http://en.wikipedia.org/wiki/NoSQL">NOSQL database</a>, which means that there’s no schema or a predefined data structure. It’s a document store and the documents are JSON objects. It also means that you don’t need to worry about structural changes in the data, since there’s little structure to begin with. This allows for great flexibility and little maintenance.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-240"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-238">
	<h3	class='typography typography--size-36-text js-typography block-heading__heading'
	data-id='es-239'
	>
	VIEWS</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-243"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-241">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-242'
	>
	If you need to build reports, aggregate and join documents, or have different representations of the data, you can use views. Views are defined in JavaScript. They are built dynamically and don’t affect the underlying data, so you can have as many as you like.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-246"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-244">
	<h3	class='typography typography--size-36-text js-typography block-heading__heading'
	data-id='es-245'
	>
	DISTRIBUTION</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-249"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-247">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-248'
	>
	Couchbase’s distribution system is incredibly complex and very powerful. It has several main characteristics, and you can fine tune your app to use any or all of them:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-252"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="lists" data-id="es-250">
	<ul	class='typography typography--size-16-text-roman js-typography lists__typography'
	data-id='es-251'
	>
	<li><strong>Master → Slave replication</strong></li><li><strong>Master <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2194.png" alt="↔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Master replication</strong></li><li><strong>Filtered Replication</strong></li><li><strong>Incremental and bi-directional replication</strong></li><li><strong>Conflict management</strong></li></ul></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-255"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-253">
	<h3	class='typography typography--size-36-text js-typography block-heading__heading'
	data-id='es-254'
	>
	NETWORK AVAILABILITY</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-258"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-256">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-257'
	>
	Additionally, you don’t need to take care of the changes in the network availability. The underlying network listener in the library monitors the changes, and pauses and resumes whatever replication you have running, leaving you ample space to notify the user of the current network status.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-261"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-259">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-260'
	>
	Replication itself can be <strong>one-shot</strong> or <strong>continuous</strong>. If you want to say when and what needs to be synced to or from the host, you will use one-shot replication. On the other hand, if the requirements say that data should be synced anytime a change occurs, then continuous replication is the way to go. Both replications will download the same data, but keeping continuous replication running requires minimal data traffic, in my case less than 100 kB/h.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-264"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-262">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-263'
	>
	How do I implement it?</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-267"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-265">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-266'
	>
	After we’ve covered the basics, let’s see just how simple setting up an app with Couchbase Lite is.<br>The official <a href="http://developer.couchbase.com/mobile/develop/training/build-first-android-app/index.html">getting started pages</a> are quite detailed and easy to follow.<br>In the following example, I use the <a href="https://cloudant.com/">Cloudant</a> service as the backend for my demo application, but you can setup your own host with CouchDb on it.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-270"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-268">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-269'
	>
	Here is a code example of the bare minimum needed to implement bidirectional replication from your Android application;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-273"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-271">
	<h4	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-272'
	>
	1. Add the repository location to the application’s root build.gradle file</h4></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-275"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-java github-light" data-language="java" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">buildscript </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    repositories </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6f42c1;">mavenCentral</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        maven </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            url </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">http://files.couchbase.com/maven2/</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6f42c1;">mavenLocal</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    dependencies </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        classpath </span><span class="token" style="color: #d73a49;">&amp;</span><span class="token">#</span><span class="token" style="color: #005cc5;">8217</span><span class="token">;</span><span class="token" style="color: #24292e;">com</span><span class="token">.</span><span class="token" style="color: #24292e;">android</span><span class="token">.</span><span class="token" style="color: #24292e;">tools</span><span class="token">.</span><span class="token" style="color: #24292e;">build</span><span class="token" style="color: #d73a49;">:</span><span class="token">gradle</span><span class="token" style="color: #d73a49;">:</span><span class="token" style="color: #005cc5;">0.9</span><span class="token">.</span><span class="token" style="color: #d73a49;">+</span><span class="token" style="color: #d73a49;">&amp;</span><span class="token">#</span><span class="token" style="color: #005cc5;">8217</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">allprojects </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    repositories </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6f42c1;">mavenCentral</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        maven </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            url </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">http://files.couchbase.com/maven2/</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-278"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-276">
	<h4	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-277'
	>
	2. Add the dependency to the module’s build.gradle file</h4></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-280"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-java github-light" data-language="java" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">compile </span><span class="token" style="color: #d73a49;">&amp;</span><span class="token">#</span><span class="token" style="color: #005cc5;">8217</span><span class="token">;</span><span class="token" style="color: #24292e;">com</span><span class="token">.</span><span class="token" style="color: #24292e;">couchbase</span><span class="token">.</span><span class="token" style="color: #24292e;">lite</span><span class="token" style="color: #d73a49;">:</span><span class="token">couchbase</span><span class="token" style="color: #d73a49;">-</span><span class="token">lite</span><span class="token" style="color: #d73a49;">-</span><span class="token">android</span><span class="token" style="color: #d73a49;">:</span><span class="token" style="color: #005cc5;">1.0</span><span class="token">.</span><span class="token">0</span><span class="token" style="color: #d73a49;">&amp;</span><span class="token">#</span><span class="token" style="color: #005cc5;">8217</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-283"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-281">
	<h4	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-282'
	>
	3. Add the following code to your application’s main activity or fragment</h4></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-285"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-java github-light" data-language="java" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;">initialise the database</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token"> </span><span class="token" style="color: #d73a49;">protected</span><span class="token"> </span><span class="token" style="color: #d73a49;">void</span><span class="token"> </span><span class="token" style="color: #6f42c1;">initDB</span><span class="token">(</span><span class="token">)</span><span class="token"> throws IOException</span><span class="token">,</span><span class="token"> CouchbaseLiteException </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> create the database manager with default options</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">Manager</span><span class="token"> </span><span class="token" style="color: #24292e;">manager</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #d73a49;">new</span><span class="token"> </span><span class="token" style="color: #6f42c1;">Manager</span><span class="token">(</span><span class="token" style="color: #d73a49;">new</span><span class="token"> </span><span class="token" style="color: #6f42c1;">AndroidContext</span><span class="token">(</span><span class="token" style="color: #24292e;">MainActivity</span><span class="token">.</span><span class="token" style="color: #24292e;">this</span><span class="token">)</span><span class="token">,</span><span class="token"> </span><span class="token" style="color: #24292e;">Manager</span><span class="token">.</span><span class="token" style="color: #24292e;">DEFAULT_OPTIONS</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> get or create the database with the provided name</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        database </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #24292e;">manager</span><span class="token">.</span><span class="token" style="color: #6f42c1;">getDatabase</span><span class="token">(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">demodb</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> add a change listener</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">database</span><span class="token">.</span><span class="token" style="color: #6f42c1;">addChangeListener</span><span class="token">(</span><span class="token">databaseListener</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;">start bi-directional syncing</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token" style="color: #d73a49;">protected</span><span class="token"> </span><span class="token" style="color: #d73a49;">void</span><span class="token"> </span><span class="token" style="color: #6f42c1;">startSync</span><span class="token">(</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">URL</span><span class="token"> </span><span class="token" style="color: #24292e;">syncUrl</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">try</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            syncUrl </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #d73a49;">new</span><span class="token"> </span><span class="token" style="color: #6f42c1;">URL</span><span class="token">(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">https://username:password</span><span class="token" style="color: #032f62;">&quot;</span><span class="token"> </span><span class="token" style="color: #d73a49;">+</span><span class="token">
</span></span><span class="line"><span class="token">                    </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">@username.cloudant.com/demodb</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token"> </span><span class="token" style="color: #d73a49;">catch</span><span class="token"> </span><span class="token">(</span><span class="token" style="color: #24292e;">MalformedURLException</span><span class="token"> </span><span class="token" style="color: #e36209;">e</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #d73a49;">throw</span><span class="token"> </span><span class="token" style="color: #d73a49;">new</span><span class="token"> </span><span class="token" style="color: #6f42c1;">RuntimeException</span><span class="token">(</span><span class="token">e</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> server - client </span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">Replication</span><span class="token"> </span><span class="token" style="color: #24292e;">pullReplication</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #24292e;">database</span><span class="token">.</span><span class="token" style="color: #6f42c1;">createPullReplication</span><span class="token">(</span><span class="token">syncUrl</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">pullReplication</span><span class="token">.</span><span class="token" style="color: #6f42c1;">setContinuous</span><span class="token">(</span><span class="token" style="color: #005cc5;">true</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> client - server </span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">Replication</span><span class="token"> </span><span class="token" style="color: #24292e;">pushReplication</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #24292e;">database</span><span class="token">.</span><span class="token" style="color: #6f42c1;">createPushReplication</span><span class="token">(</span><span class="token">syncUrl</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">pushReplication</span><span class="token">.</span><span class="token" style="color: #6f42c1;">setContinuous</span><span class="token">(</span><span class="token" style="color: #005cc5;">true</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> replication listeners</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">pullReplication</span><span class="token">.</span><span class="token" style="color: #6f42c1;">addChangeListener</span><span class="token">(</span><span class="token">pullReplicationListener</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">pushReplication</span><span class="token">.</span><span class="token" style="color: #6f42c1;">addChangeListener</span><span class="token">(</span><span class="token">pushReplicationListener</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;"> start both replications</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">pullReplication</span><span class="token">.</span><span class="token" style="color: #6f42c1;">start</span><span class="token">(</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #24292e;">pushReplication</span><span class="token">.</span><span class="token" style="color: #6f42c1;">start</span><span class="token">(</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #6a737d;">//</span><span class="token" style="color: #6a737d;">call those methods in the onCreate</span><span class="token" style="color: #6a737d;">
</span></span><span class="line"><span class="token">@</span><span class="token" style="color: #d73a49;">Override</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">protected</span><span class="token"> </span><span class="token" style="color: #d73a49;">void</span><span class="token"> </span><span class="token" style="color: #6f42c1;">onCreate</span><span class="token">(</span><span class="token" style="color: #24292e;">Bundle</span><span class="token"> savedInstanceState</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #005cc5;">super</span><span class="token">.</span><span class="token" style="color: #6f42c1;">onCreate</span><span class="token">(</span><span class="token">savedInstanceState</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #6f42c1;">setContentView</span><span class="token">(</span><span class="token" style="color: #24292e;">R</span><span class="token">.</span><span class="token" style="color: #24292e;">layout</span><span class="token">.</span><span class="token" style="color: #24292e;">activity_main</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">try</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #6f42c1;">initDB</span><span class="token">(</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #6f42c1;">startSync</span><span class="token">(</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token"> </span><span class="token" style="color: #d73a49;">catch</span><span class="token"> </span><span class="token">(</span><span class="token" style="color: #24292e;">Exception</span><span class="token"> </span><span class="token" style="color: #e36209;">e</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #24292e;">e</span><span class="token">.</span><span class="token" style="color: #6f42c1;">printStackTrace</span><span class="token">(</span><span class="token">)</span><span class="token">;</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-288"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-286">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-287'
	>
	The only thing left to do is to define some data in the database and show it to the users.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-291"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-289">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-290'
	>
	When to use Couchbase Mobile?</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-294"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-292">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-293'
	>
	As always, you should find the best tool for the problem at hand. If your data is well structured and stable with no room for modification, then standard relational databases are the way to go.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-297"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-295">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-296'
	>
	If your data is flexible and should be available anytime and anywhere, this is by far the simplest solution.</p></div>	</div>
</div>
</div>		</div>
	</div><p>The post <a href="https://infinum.com/blog/server-client-syncing-for-mobile-apps-using-couchbase-mobile/">Simple Server-Client Syncing for Mobile Apps Using Couchbase Mobile</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</content:encoded>
			</item>
		
	</channel>
</rss>