As you probably know the new Cocoon cloud is based on Cordova and this means that your project structure must be compliant with Cordova but don’t worry, we have made an effort to abstract you from the Cordova internals as much as possible so you only need to use the Cocoon configuration UI and the developer app to get your project ready.

Let’s start with some general questions that you all probably have when start working with Cocoon.

What should I include in my code?

For your app to be ready to use Cordova, you just need to include the Cordova script in your project header. This will make the Cordova to boot when loading your app. When the Cordova framework is ready, it will emit a “deviceready” event and then you can start using Cordova and any plugin that you are using.

See the code snippet below for a basic Cordova integration.

You can see the plugin guides for more information about how to integrate Cordova plugins.

How do I compress it for upload to the cloud?

When preparing your code you only need to zip the content of the folder where your index.html is. In the following project structure:

Screen Shot 2015-12-31 at 13.00.45

You should only zip the content of the 4053 folder, not the 4053 folder itself.

If you have a Cordova project structure in your local filesystem, you should only compress the contents of the www folder:

Screen Shot 2015-12-31 at 13.07.22

So basically make sure that in the root if your zip file there is always a index.html file to run.

How do I develop in local?

The easiest way of developing your app for Cocoon in local is to compile a Developer App for your app. Once you have created your Cocoon app in the cloud you have the option of compiling a Developer App from the project details. This will compile a Developer App configured as your application and ready to run Cordova applications. Then you download it an you can start developing your app with it. If you need more information about the Developer App, you can read the guide here.

How do I use plugins?

For developing using plugins you just need to compile the Developer App with the plugins you need and then you can use that Developer App to test your app and develop.