forcedotcom/SalesforceMobileSDK-Shared — pull request #133 by wmathurin (2013-10-25 00:55:50+00:00)
Title: Cordova 3.1 

For review only. I'm still working through test failures, however all the sample apps seem to be working now.
Also we probably want to assess the effort on the iOS side before moving forward.

Cordova (js and jar) don't include any plugins. So the plugins code need to be part of the app.
Cordova expects a cordova_plugins.js next to the cordova.js and it expects cordova.js to be named exactly that (not cordova-xxx.js). The application doesn't need to src include the cordova_plugins.js. Cordova iterates over the script tags of the page, looks for one loading cordova.js, extract the path, and inject a new script tag going to the same path but ending with cordova_plugins.js.

To get the plugin code, I did the following:

npm install cordova
cordova create xyz
cd xyz
cordova plugin add org.apache.cordova.contacts
cordova platform add android
And I got the plugin js from the xyz/platforms/android/asset/www/plugins directory and I got the cordova_plugins.js from xyz/platforms/android/asset/www/. Our plugins right now don't use that approach, instead they are explicitly included.