If you want to include AdMob* (by Google*) advertisements as part of your HTML5 hybrid mobile app, you will need to use a Cordova plugin. Unlike the desktop browser solution, mobile apps require a native code component to retrieve and display ads on mobile devices. Not all mobile ad services have this restriction, but if you want to serve AdMob advertisements in your app you will have to use a Cordova plugin.
Intel does not endorse any specific advertising plugin for use with the Intel XDK! Be aware that some advertising plugins have fees or revenue sharing features built into them. We cannot guarantee which plugins are the best or most appropriate for use with your application.
There are a variety of Cordova plugins available for serving ads; some serve ads from third-party sources, a few serve ads from the AdMob network. You are not required to use AdMob to serve ads, but only the use of AdMob plugins are described in this article. Plugins for ad services can be located by doing a general search of the web for "mobile ad services."
AdMob plugins for Cordova can be found by searching the Cordova Plugins Registry or PlugReg (an independent Cordova plugin registry). Details regarding how to use the AdMob system as a means of monetization are available in the AdMob support pages.
Before you can serve any AdMob ads you must sign up for an AdMob account at www.admob.com. AdMob does not charge a fee for creating an account or for serving up AdMob ads (be aware that some AdMob plugins vendors do charge a fee for the use of their plugin). If you have an AdMob account you must create a set of Ad Unit IDs that identify your ad impressions and provide these IDs as part of the AdMob API initialization sequence within your app. A screenshot of the online AdMob tool you use to create the Ad Unit IDs is shown below.
IMPORTANT: each application should have its own set of Ad Unit IDs! If you do not yet have an app in an app store, you can use the "manual" method to identify your app for the purpose of obtaining Ad Unit IDs.
To see the latest available samples provided with the Intel XDK it is best to check the "Work with a Demo" option under the "Start a New Project" button. In addition to those samples provided on the Intel XDK "Work with a Demo" panel, a few additional examples are listed below; they may use different AdMob plugins (from different authors):
The article titled HTML5 Hybrid Apps with Admob* Cordova* Plugins provides details for several of the AdMob examples available in the Intel XDK.
NOTE: because an AdMob application includes a third-party Cordova plugin, it will only run on a real device. You must use the Build tab to create an APK (for Android) or IPA (for iOS) to test your AdMob application. If you attempt to run this app using the Emulate, Test or Debug tabs the AdMob APIs will fail. Apps that utilize Cordova plugins can only be built using the Cordova build targets. Attempting to use the "legacy" build targets will not work.