Embed Cordova plugins in a GMA app
To be included in your app, Cordova plugins need to be specified in the build process.
Including Cordova plugins in your Androidâ„¢ APK package
Use the gmabuildtool
--build-cordova
command-line option, to specify which Cordova plugins to embed in
your Android APK package:
gmabuildtool build
--build-cordova cordova-plugin-contacts,cordova-plugin-device
...
The plugin.xml file
A plugin can contain several assets (images, sounds, native forms) which are listed in the plugin.xml file that is bundled by gmabuildtool.
Shipping the Cordova wrapper library with the app package
If the Cordova plugin front calls are called from BDL wrapper functions, the .42m p-code module of the wrapper library needs to be included in the APK package.
When building the APK package for an app using Cordova plugins, the gmabuildtool automatically includes the corresponding .42m wrapper module(s).