DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Trending

  • Five Java Books Beginners and Professionals Should Read
  • Conditional Breakpoints: A Guide to Effective Debugging
  • Top 10 Pillars of Zero Trust Networks
  • Clear Details on Java Collection ‘Clear()’ API

Tutorial: From Dropbox Datatore Sync to Couchbase Mobile

G. Ryan Spain user avatar by
G. Ryan Spain
·
May. 22, 15 · Interview
Like (1)
Save
Tweet
Share
3.89K Views

Join the DZone community and get the full member experience.

Join For Free

[This article was written by James Nocentini, Co-Founder and Chief Architect of Mobile at Couchbase.]

The Dropbox Datastore and Sync APIs were recently deprecated.

Last week, Chris Anderson wrote a blog post on why you should choose open source projects to solve this really challenging problem.

Now it’s time to code!

We will start with the Lists-ios example app demonstrating how to use the Datastore API.

Once you link the app with your Dropbox account you can sync Lists to the iOS app and Web app:

In the screencast video, we’ll take a look at what it takes to migrate it to Couchbase Mobile. I will do so using Couchbase Lite packaged in the app and Sync Gateway as the sync server:

The changes to the source code are:

  • setting up the database in the viewDidLoad method (timestamp: 4m40s, GitHub: code snippet)
  • saving documents locally when the keyboard returns (timestamp: 12m14s, GitHub: code snippet)
  • initialising the live query (timestamp: 6m, GitHub: code snippet)

There are many other features I didn’t cover in this screencast such as user authentication, configuring the sync function and installing Couchbase Server to persist those documents on the server-side.

The ToDoLite-iOS and ToDoLite-Android demo apps use Facebook Login to authenticate users and share lists. The access control rules for determining the users that have access to a given list are defined in the sync function.

One last point I didn’t cover in the screencast is how to build a web client for your application with Couchbase Mobile. That could be a simple website or a more full featured web app. We could use the Sync Gateway REST API for fetching the List and Task documents and/or use PouchDB to sync the documents to and from Sync Gateway.

Sync (Unix) mobile app Dropbox (service)

Published at DZone with permission of . See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Five Java Books Beginners and Professionals Should Read
  • Conditional Breakpoints: A Guide to Effective Debugging
  • Top 10 Pillars of Zero Trust Networks
  • Clear Details on Java Collection ‘Clear()’ API

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: