• This repository has been archived on 09/Mar/2022
  • Stars
    star
    203
  • Rank 188,403 (Top 4 %)
  • Language
    C
  • Created almost 13 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The android build for humans.

!!This project is no longer being maintained! Please use couchbase-lite-android instead!!

Mobile Couchbase for Android

Apache CouchDB on Android provides a simple way to sync your application data across devices and provide cloud backup of user data. Unlike other cloud solutions, the data is hosted on the device by Couchbase Mobile, so even when the network is down or slow (airplane, subway, backyard) the application is responsive to users.

What this means for you:

  • You can embed the rock solid distributed database, Mobile Couchbase, on your Android device.
  • Your Android apps can use Apache CouchDB's well-proven synchronization technology.
  • If you <3 CouchApps, you can deploy them as Android apps.

Join us

There is a Google Group here for Mobile Couchbase. Let's talk about how to optimize the Erlang build, what the best Java APIs are for CouchDB, how to take advantage of replication on mobile devices. It'll be fun.

Bug Tracker

There is a bug tracker available at http://www.couchbase.org/issues/browse/CBMA

Getting Started

If you have questions or get stuck or just want to say hi, email [email protected] and let us know that you're interested in Couchbase on mobile.

These instructions require you to have installed Eclipse and the Android SDK, the Android developer website has instructions.

Installing Couchbase into your Application

NOTE: You do not need the source of this repository to use Mobile Couchbase in your Android application.

  1. Create a new Android project or select an existing project

  2. Download the Android-Couchbase.zip

  1. Extract Android-Couchbase.zip, you will see 3 files
  • Couchbase.zip
  • couchbase.xml
  • README.txt
  1. Place Couchbase.zip and couchbase.xml into the top-level of your project

  2. Right-click on couchbase.xml and select Run As > Ant Build

  3. Refresh your project

Starting Couchbase

Now that your project supports Couchbase, starting Cocuhbase is accomplished by adding a few things to your application's Main Activity.

  1. Create an instance of ICouchbaseDelegate, you can implement these methods to respond to Couchbase events
    
    private final ICouchbaseDelegate mDelegate = new ICouchbaseDelegate() {
        @Override
        public void couchbaseStarted(String host, int port) {}
    
        @Override
        public void exit(String error) {}
    };
  1. Declare a ServiceConnection instance to keep a reference to the Couchbase service
    private ServiceConnection couchServiceConnection;
  1. Add a method to start Couchbase
        public void startCouchbase() {
                CouchbaseMobile couch = new CouchbaseMobile(getBaseContext(), mCallback);
                couchServiceConnection = couch.startCouchbase();
        }
  1. Call the startCouchbase method from the appropriate Activity lifecycle methods. For many applications the onCreate method is appropriate
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        ...
    
        startCouchbase();
    }

Broadcast Intents

A Broadcast Receiver registered to listen for the right events can now be used instead of a delegate.

  1. Optionally, use the CouchbaseMobile constructor without the delegate parameter
    CouchbaseMobile couch = new CouchbaseMobile(getBaseContext());
  1. Declare a Broadcast Receiver
    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            if(CouchbaseStarted.ACTION.equals(intent.getAction())) {
                String host = CouchbaseStarted.getHost(intent);
                int port = CouchbaseStarted.getPort(intent);
            }
            else if(CouchbaseError.ACTION.equals(intent.getAction())) {
                String message = CouchbaseError.getMessage(intent);
            }
        }
    };
  1. Register the receiver to listen for the appropriate events
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ...

        registerReceiver(mReceiver, new IntentFilter(CouchbaseStarted.ACTION));
        registerReceiver(mReceiver, new IntentFilter(CouchbaseError.ACTION));
    }

Examples

For examples please look at:

Build information

To build the Android-Couchbase project from source run the following ant command:

ant -Dsdk.dir=/path/to/android/sdk dist

Replacing the value for sdk.dir with the path to the Android SDK on the build server.

The current build of Android Couchbase embed the CouchDB binaries. There is information on how to build these binaries on the SourceBuild project.

Manual Installation

In some environments it may not be possible to use the couchbase.xml ant script installer. Couchbase can be installed manually using the following steps.

  1. Unzip the Couchbase.zip archive. This will produce another zip file named overlay.zip.

  2. Remove any existing couchbase*.jar file from /libs

  3. Extract the contents of the overlay.zip file into your project. This will place all assets and libraries in the correct location within the structure of your project.

    cd unzip //overlay.zip

  4. Update the project's AndroidManifest.xml to declare the Couchbase service and request the required permissions.

    Within the "application" section add:

    Within the "manifest" section add:

Requirements

  • Android 2.1 or newer
  • Eclipse 3.6.2 or newer (if using Eclipse)
  • Ant 1.7.1 or newer (if using Ant outside of Eclipse)
  • When testing in the emulator, be sure to create an SD Card with sufficient space for your databases
  • If using views in the emulator, create an AVD with CPU/ABI set to armeabi-v7a

License

Portions under Apache, Erlang, and other licenses.

The overall package is released under the Apache license, 2.0.

Copyright 2011, Couchbase, Inc.

More Repositories

1

TouchDB-iOS

CouchDB-compatible mobile database; Objective-C version
Objective-C
764
star
2

iOS-Couchbase

This repository fork is obsolete; the project's been restructured and development is going on in other repos. Please follow the link below, or read the current README.
Erlang
403
star
3

node-ottoman

Node.js ODM for Couchbase
TypeScript
285
star
4

TouchDB-Android

CouchDB-compatible mobile database; Android version
Java
240
star
5

CouchCocoa

Objective-C API for CouchDB on iOS and Mac OS
Objective-C
218
star
6

ToDoLite-Android

To-Do list sample app for Couchbase Lite, native Android version
Java
186
star
7

cbfs

Distributed Blobstore using Couchbase Server
Go
185
star
8

Couchbase-Lite-PhoneGap-Plugin

Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android
Objective-C
183
star
9

Grocery-Sync-iOS

The simplest Couchbase Lite demo app for iOS
Objective-C
154
star
10

mini-hacks

A fun and quick way to discover the beauty of Couchbase Mobile in real apps.
Java
137
star
11

GrocerySync-Android

Couchbase Lite demo app for Android: A simple synced shopping list
Java
136
star
12

react-native-couchbase-lite

Couchbase Lite binding for React Native Android & iOS
Java
111
star
13

couchbase-rs

The official, community supported Couchbase Rust SDK
C
100
star
14

Linq2Couchbase

A Language Integrated Query (LINQ) provider for the Couchbase .NET SDK
C#
91
star
15

nativescript-couchbase

Objective-C
87
star
16

ToDoLite-iOS

To-Do list sample app for Couchbase Lite, native iOS version
Objective-C
85
star
17

CouchbaseLiteViewer

Mac app for viewing/modifying Couchbase Lite databases
Objective-C
81
star
18

iMonkey

Threadsafe Spidermonkey Static Library for iOS
C++
81
star
19

CouchChat-iOS

Couchbase Lite demo app for iOS: A chat client
Objective-C
78
star
20

cbgb

an experimental server, the birthplace of punk, and a future backcronym
Go
60
star
21

couchstore

couchbase storage file library
C
58
star
22

devguide-examples

Examples for topics in the developer guide
C
58
star
23

mobile-training-todo

ToDo List app built with Couchbase Mobile
Java
57
star
24

touchbase

A Couchbase N1QL example of a social network app using Angular.js and Node.js
JavaScript
56
star
25

vagrants

Vagrant files to provision Couchbase VMs
Puppet
56
star
26

try-cb-java

Java-Based Couchbase 7.0 travel-sample application
Java
56
star
27

TodoLite-PhoneGap

Basic todo list app for Couchbase Lite and PhoneGap
JavaScript
55
star
28

couchbase-shell

Shell yeah!
Rust
55
star
29

try-cb-nodejs

JavaScript
51
star
30

couchbase-server-coreos

Dockerfiles and scripts for running Couchbase Server under Docker and CoreOS
43
star
31

Couchbase-by-Example

Series of tutorials for Couchbase Lite, Sync Gateway and Couchbase Server
Swift
42
star
32

couchbase-mobile-tools

A repo for hosting both supported and unsupported tools made by Couchbase
C++
41
star
33

photo-drop

P2P Photo Sharing app. Read more http://blog.couchbase.com/photodrop
Swift
40
star
34

iOS-Couchbase-manifest

Repo manifest for (legacy) iOS-Couchbase project. Current development is on the next gen native version: TouchDB (see link)
37
star
35

iErl14

Project to build static lib for iOS containing Erlang VM BEAM, CouchDB drivers, emonk interface to spidermonkey
C
35
star
36

query

PLEASE NOTE: code is currently maintained at
Go
35
star
37

try-cb-dotnet

Couchbase Travel Sample app written in ASP.NET
C#
34
star
38

sdk-rfcs

SDK RFCs
34
star
39

ForestDB-Benchmark

Benchmark program for ForestDB, Couchstore, LevelDB, RocksDB, and WiredTiger
C++
34
star
40

php-couchbase-v2

Couchbase 2.0 API based on pecl/memcached. For 3.0 see couchbase-php
PHP
34
star
41

cellar

An experimental KV store, which implements an LSM on top of Bolt segments.
Go
32
star
42

WebSockets-Cocoa

Objective-C implementation of WebSockets and BLIP protocols, for iOS and Mac OS
Objective-C
32
star
43

CouchChat-PhoneGap

=> https://github.com/couchbaselabs/TodoLite-PhoneGap
31
star
44

TodoLite-Ionic

To-Do list sample app for Couchbase Lite, using Ionic and the PhoneGap plugin
JavaScript
31
star
45

libcouchbase-cxx

Header-only C++11 Couchbase Client
C++
30
star
46

walrus

Tiny Go implementation of Couchbase Bucket API, for testing
Go
28
star
47

restful-angularjs-nodejs

An example of using the Node.js SDK for Couchbase with an AngularJS frontend
JavaScript
27
star
48

cbft

*THIS PROJECT HAS MOVED* from couchbaselabs TO: https://github.com/couchbase/cbft -- no further development will be done here on couchbaselabs/cbft
Go
27
star
49

cean-web-chat

Real-time chat with the CEAN stack and Socket.io
JavaScript
26
star
50

CouchDraw

A synchronized drawing app that utilizes Couchbase Sync Gateway and Xamarin to enable shared canvases.
C#
25
star
51

crouton

C++20 coroutine runtime and cross-platform I/O library
C++
25
star
52

ng-couchbase-lite

AngularJS Wrapper for Couchbase Lite RESTful Endpoints
JavaScript
24
star
53

cbugg

Because all bug systems are bad and I like writing bad code.
JavaScript
23
star
54

blog-source-code

Source code for blog posts
C#
23
star
55

OnTheSpot

Saves photos with lat/lon and other telemetry to Mobile Couchbase. Please fork and play with it, we hope it becomes the basis for other folks "real" apps. Coolest part about it is the different apps can share the same dataset, and hence share network effects.
Objective-C
23
star
56

mobile-travel-sample

Mobile Version of Travel sample App using Couchbase Lite 2.x
Java
22
star
57

try-cb-python

Couchbase Travel Sample Application Python REST API Backend
Python
22
star
58

Android-Couchbase-SourceBuild

Full source build of Android stuff.
Shell
22
star
59

couchbase-nginx-module

The module for nginx webserver to access Couchbase Server
C
22
star
60

learningportal

A Learning Portal built with Couchbase Server 2.0 and ElasticSearch
Ruby
21
star
61

pouchdb-angular2

Couchbase Mobile Web Application with PouchDB and Angular 2
TypeScript
21
star
62

showfast

Performance dashboard
HTML
19
star
63

couchbase-net-examples

Examples for configuring and using the Couchbase .NET SDK 2.0
C#
18
star
64

couchbase-lite-titanium

Couchbase Lite Titanium Module
Objective-C
18
star
65

erlgeom

Erlang binding for geometry libraries
Erlang
18
star
66

sdk-doctor

Application-server-side cluster connection diagnostics.
Go
18
star
67

tuqtng

TUQ - The Next Generation
Go
18
star
68

Couchbase.Lite.Mapping

A simple library that extends Couchbase.Lite to provide extension methods for converting an object to a Document/MutableDocument and a Document/MutableDocument to an object.
C#
18
star
69

sequoia

Scalable testing with containers
Python
17
star
70

gameapi-nodejs

Make a simple game server API using NodeJS and Express
JavaScript
17
star
71

couchbase-lite-local

Run a couchbase lite instance with REST interface locally on you Mac or Raspberry Pi
Ruby
17
star
72

sg-replicate

A tool that can drive a replication between Sync Gateway instances
Go
17
star
73

couchbase-capi-server

OBSOLETE, NO LONGER MAINTAINED. An abstract Java HTTP server for pretending to be a Couchbase Server node.
Java
17
star
74

DeveloperDay

Couchbase Developer Day Sample Code By Language
Java
17
star
75

cbforest

C++ wrapper library around ForestDB, for use in Couchbase Lite.
C++
17
star
76

dcp-documentation

couchbase unified protocol for replication
17
star
77

BLIP-Cpp

C++ implementation of BLIP network protocol
C++
16
star
78

couchbase-spark-samples

Examples on how to use the Couchbase Spark Connector
Scala
16
star
79

couchtalk-node

Example push-to-talk app using Couchbase Server, node.js, and the browser.
JavaScript
16
star
80

php-ext-couchbase

A PHP extension wrapping libcouchbase (work in progress)
C
16
star
81

try-cb-golang

Go
16
star
82

todolite-electron-pouchdb

Example to demonstrate Couchbase in an Electron desktop application with PouchDB
JavaScript
15
star
83

couchbase-spring-cache

An implementation for Spring Cache based on Couchbase Java SDK 2.x
15
star
84

mobile-testkit

Mobile QE Test Framework
Python
15
star
85

sync_gateway_admin_ui

Admin UI for Sync Gateway, submodule to couchbase/sync_gateway
JavaScript
15
star
86

couchbase-scala-client

The (not yet) Official Couchbase Scala SDK
Scala
14
star
87

pouchdb-angularjs-app

Sync data with Couchbase using AngularJS and PouchDB
JavaScript
14
star
88

spring-data-couchbase

!! The project moved over to: https://github.com/springsource/spring-data-couchbase
Java
14
star
89

couchbase-aspnet-identity

A custom storage provider for ASP.NET Identity that uses Couchbase Server as a storage medium.
C#
14
star
90

ionic2-web-chat

JavaScript
14
star
91

ToDoLite-Xamarin-Forms

C#
14
star
92

docs-ng

Official repository for Couchbase documentation
HTML
14
star
93

BLIP-Cocoa

Implementation of the BLIP messaging protocol, for iOS and Mac OS X
Objective-C
14
star
94

Couchbase-Lite-PhoneGap-Kit

HTML5 apps love JSON data, this is an easy starter kit for Cordova and Couchbase Lite
Objective-C
13
star
95

PicMapper

Reads EXIF data from your Camera Roll and adds thumbnails to Couchbase Lite for display in MapKit
Swift
13
star
96

restful-angularjs-java

An example of using the Java SDK for Couchbase with an AngularJS frontend
Java
13
star
97

cloud-formation

Templates for Couchbase software for the Amazon AWS CloudFormation
JavaScript
13
star
98

cboperator-hol

This repo will have hands-on labs for Couchbase Operator for different public cloud environments
Shell
13
star
99

Couchbase-Sync-Gateway-Postman-Collection

Postman Collections for Sync Gateway 3.0 REST Interface
13
star
100

bikeshop-cb

Node.js Example Application for Couchbase using the Ottoman ODM
JavaScript
12
star