This tutorial for HTML5 and JavaScript developers explains how you can integrate InMobi banners into you MoSync HTML5 application.
InMobi is an ad banner provider you can use for in-app adverticements in your HTML5/JS app.
An easy way to get started is to use InMobi's test account. In the long run, however, you will need your own InMobi developer account and a site id. MoSync developers can sign up for an account with InMobi at www.inmobi.com/partners/MoSync. See InMobi's JavaScript documentation for more information about their JavaScript API.
To try out the InMobi Ad API, you can use either MoSync Reload or the MoSync SDK.
Run the app on your device to confirm that it works by pressing Reload in the Development UI. You should see this user interface displayed on connected devices:

<script>
var inmobi_conf = {
siteid : "4028cba631d63df10131e1d3191d00cb",
slot : "15",
test: true };
</script>
<script src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>

Using InMobi's JavaScript advertisement API with the MoSync SDK is as simple as using it with Reload. Just open the MoSync Eclipse IDE and create a new project in the from the HTML/JS WebUI template, then edit the file index.html as outlined above.
To get started with developing HTML5/JS apps using MoSync SDK, check out the guide Getting Started with HTML5 and JavaScript.
The following is the full code example for the updated version of index.html:
<!DOCTYPE html>
<!--
* @file index.html
*
* Template application that shows examples of how to access
* device services from JavaScript using the Wormhole library.
-->
<html>
<head>
<meta name="viewport" content="width=320, user-scalable=no">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Wormhole Template App</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="js/wormhole.js"></script>
<script type="text/javascript">
/**
* Displays the device information on the screen.
*/
function displayDeviceInfo()
{
document.getElementById("platform").innerHTML = device.platform;
document.getElementById("version").innerHTML = device.version;
document.getElementById("uuid").innerHTML = device.uuid;
document.getElementById("name").innerHTML = device.name;
document.getElementById("width").innerHTML = screen.width;
document.getElementById("height").innerHTML = screen.height;
}
/**
* Vibrate device.
*/
function vibrate()
{
navigator.notification.vibrate(500);
}
/**
* Play one beep sound.
*/
function beep()
{
navigator.notification.beep(1);
}
/**
* Change page background to a random color.
*/
function changeColor()
{
var color = "#" +
(Math.random() * 0xFFFFFF + 0x1000000)
.toString(16).substr(1,6);
document.documentElement.style.backgroundColor = color;
document.body.style.backgroundColor = color;
}
// Register event listeners.
// The "deviceready" event is sent when the system
// has finished loading.
document.addEventListener(
"deviceready",
displayDeviceInfo,
true);
// Close the application when the back key is pressed.
document.addEventListener(
"backbutton",
function() { mosync.app.exit(); },
true);
</script>
</head>
<body>
<div id="screen">
// Start of ad banner code.
<script>
var inmobi_conf = {
siteid : "4028cba631d63df10131e1d3191d00cb",
slot : "15",
test: true
};
</script>
<script src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>
// End of ad banner code.
<div class="pane" id="heading">Customized Wormhole Technology</div>
<div class="pane" id="info">
<div class="infoItem">Platform: <span id="platform"> </span></div>
<div class="infoItem">Version: <span id="version"> </span></div>
<div class="infoItem">UUID: <span id="uuid"> </span></div>
<div class="infoItem">Name: <span id="name"> </span></div>
<div class="infoItem">Width: <span id="width"> </span></div>
<div class="infoItem">Height: <span id="height"> </span></div>
</div>
<div class="pane button" onclick="vibrate()">Vibrate</div>
<div class="pane button" onclick="beep()">Beep</div>
<div class="pane button" onclick="changeColor()">Change Color</div>
</div>
</body>
</html>