compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (16)

View Page History
Get the [2.0.0-beta release here.|http://packages.couchbase.com/releases/mobile/android/android-2.0.0-beta/android-couchbase-2.0.0-beta.zip]


h3. {color:#a30a0a}Getting Started{color}

{color:#5b5352}1. Create an instance of ICouchbaseDelegate, you can implement these methods to respond to Couchbase events:{color}
{color:#5b5352} {color}
  {color:#000000}{*}private{*}{color}{color:#222222} {color}{color:#000000}{*}final{*}{color}{color:#222222} ICouchbaseDelegate couchCallbackHandler {color}{color:#339933}={color}{color:#222222} {color}{color:#000000}{*}new{*}{color}{color:#222222}ICouchbaseDelegate{color}{color:#009900}({color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}

{color:#222222}      @Override{color}
{color:#222222}    {color}{color:#000000}{*}public{*}{color}{color:#222222} {color}{color:#000066}{*}void{*}{color}{color:#222222} couchbaseStarted{color}{color:#009900}({color}[String|http://www.google.com/search?hl=en&q=allinurl%3Astring+java.sun.com&btnI=I%27m%20Feeling%20Lucky]{color:#222222} host, {color}{color:#000066}{*}int{*}{color}{color:#222222} port{color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}{color:#009900}}{color:}    @Override{color}
{color:#222222}    {color}{color:#000000}{*}public{*}{color}{color:#222222} {color}{color:#000066}{*}void{*}{color}{color:#222222} exit{color}{color:#009900}({color}[String|http://www.google.com/search?hl=en&q=allinurl%3Astring+java.sun.com&btnI=I%27m%20Feeling%20Lucky]{color:#222222} error{color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}{color:#009900}}{color:}}{color}{color:#339933};{color}
{color:#222222}     {color} {color:#000000}{*}public{*}{color}{color:#222222} {color}{color:#000066}{*}void{*}{color}{color:#222222} couchbaseStarted{color}{color:#009900}({color}[String|http://www.google.com/search?hl=en&q=allinurl%3Astring+java.sun.com&btnI=I%27m%20Feeling%20Lucky]{color:#222222} host, {color}{color:#000066}{*}int{*}{color}{color:#222222} port{color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}}{color:}   {color}

{color:}      @Override{color}
{color:#222222}     {color} {color:#000000}{*}public{*}{color}{color:#222222} {color}{color:#000066}{*}void{*}{color}{color:#222222} exit{color}{color:#009900}({color}[String|http://www.google.com/search?hl=en&q=allinurl%3Astring+java.sun.com&btnI=I%27m%20Feeling%20Lucky]{color:#222222} error{color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}}

   }


{color:#5b5352} {color}
{color:#5b5352}2. Declare a ServiceConnection instance to keep a reference to the Couchbase service:{color}
{color:#5b5352}3.  Add a method to start Couchbase:{color}
{color:#5b5352} {color}
{color:#222222}        {color}{color:#000000}{*}public{*}{color}{color:#222222} {color}{color:#000066}{*}void{*}{color}{color:#222222} startCouchbase{color}{color:#009900}({color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}
{color:#222222}   {color} {color:#000000}{*}public{*}{color}{color:#222222} {color}{color:#000066}{*}void{*}{color}{color:#222222} startCouchbase{color}{color:#009900}({color}{color:#009900}){color}{color:#222222} {color}{color:#009900}{{color}
{color:#222222}                CouchbaseMobile couch {color}{color:#339933}={color}{color:#222222} {color}{color:#000000}{*}new{*}{color}{color:#222222}CouchbaseMobile{color}{color:#009900}({color}{color:#222222}getBaseContext{color}{color:#009900}({color}{color:#009900}){color}{color:#222222}, couchCallbackHandler{color}{color:#009900}){color}{color:#339933};{color}
{color:#222222}                couchServiceConnection {color}{color:#339933}={color}{color:#222222} couch.{color}{color:#006633}startCouchbase{color}{color:#009900}({color}{color:#009900}){color}{color:#339933};{color}
{color:#222222}        {color}{color:#009900}}{color:} {color}
{color:#222222}   {color} }{color:} {color}
{color:#5b5352} {color}
{color:#5b5352}4.  Call the startCouchbase method from the appropriate Activity lifecycle methods.  For many applications the onCreate method is appropriate:{color}
{color:#222222}        ...{color}
{color:#222222}        {color}{color:#006633}startCouchbase{color}{color:#009900}({color}{color:#009900}){color}{color:#339933};{color}
{color:#222222}   {color} }

{color:#222222}    {color}{color:#009900}}{color:}Once {color:}Once Couchbase has started you will get a notification by your delegate callback being called with couchbaseStarted. At that point you have can construct a server and database URLs, and proceed by using high-level libraries like Ektorp.{color}
{color:#5b5352} {color}


* [Community Mailing List|https://groups.google.com/forum/#!forum/mobile-couchbase]
* [Web Forums\|/forums/couchbase/mobile|]
* [Report Bugs\|/issues/browse/CBMA|]