#Cordova Container for Sugar
Instruction to setup the development environment
Run the following commands:
cd cordova-plugman npm install sudo npm link cd .. cd cordova-lib npm install sudo npm link cd .. cd cordova-cli npm install sudo npm link npm link ../cordova-lib/cordova-lib cordova-lib npm link ../cordova-plugman/ plugman
commands used to develop a sugar app using cordova
creating a project
cordova create "project directory" "project id" "project name"
Add the sugar platform to your project
cordova platform add sugar
Building the project
Normal build with no extra toolbox buttons
cordova build sugar
Adding extra toolbutton
If you have added extra toolbutton then compile your app using the following command :
cordova build sugar -- noiframe
Adding Plugins to your project
To add plugins to your project - copy the plugin you wish to add from the plugin folder of this repository, and paste in your project directory's plugin folder, follow the plugin documentation at the apache cordova's website or you can see the sample applications for sugar using that plugin in the sample apps directory of the plugin folder of this repo.
Installing the xo in sugar
To install your xo in sugar environment :
Find the .xo file in cordova project directory/platform/sugar/cordova folder
Copy the file from the location and paste in sugar build
Go to the sugar shell and issue the command - sugar-install-bundle .xo
You are through ! Run the sugar shell and open the activity ! - If you havent changed the icon, it shows cordova icon by default as activity icon.
Please make changes on sugar side to enable successful run of cordova plugins. This will cater to the backend of the API calls which are generated from the web app. Please look into - https://github.com/puneetgkaur/sugar-cordova/tree/master/changes%20in%20sugar%20build