This lesson teaches you to
Creating a new project
When you begin writing a new app you need to incorporate Couchbase Lite into your project. This lesson shows you how to add Couchbase Lite and its other dependencies to a new project.
Create a new project for iOS
Open Xamarin Studio and do the following:
- Select File > New > Solution.
- In the New Solution, select iOS > Classic API > iPhone > Empty Project.
- Enter the following information and click OK.
- Name : HelloCBL
- Solution Name : HelloCBL
- The HelloCBL solution will be created and opened. You should be able to see
AppDelegate.cs, which is the starting point of the application. - Select View > Debugto see both the Solution structure and the editor pane.
- Add Couchbase Lite .NET library to project
Create a new project for Android
Open Xamarin Studio and do the following:
- Select File > New > Solution.
- In the New Solution, select Android > Android Application.
- Enter the following information and click OK.
- Name : HelloCBL
- Solution Name : HelloCBL
- The HelloCBL solution will be created and opened. You should be able to see
MainActivity.cs, which is the main activity of the application. - Select View > Debugto see both the Solution structure and the editor pane.
- Add Couchbase Lite .NET library to project
Add Couchbase Lite .NET library
Developers can use Couchbase Lite .NET library by adding the Couchbase Lite .NET NuGet package.
- Select Project > Add Packages ....
- Search for 'Couchbase Lite' and select the latest version of the Couchbase Lite and click Add.
It may take a few minutes for the Xamarin Studio to add the packages and all of the dependencies. Under the HelloCBL > Packages folder, the following packages should be seen:
- Couchbase.Lite
- Newtonsoft.Json
- SQLitePCL.raw_basic
- SQLitePCL.raw_needy
- SQLitePCL.ugly
Add the Starter Code
In your main application code, i.e. AppDelegate.cs or MainActivity.cs, add the using statement as follows:
using Couchbase.Lite;