Blog


Use Mobile API

For mobile apps, you can load an ad banner in a WebView.

Adrelevantis mobile API loads ad banner in a WebView.

The following Java code is for Android device. The data is provided as query string to match an ad banner, which is displayed in the WebView adWebView.

adWebView = (WebView)rootView.findViewById(R.id.adWebview);
adWebView.setInitialScale(1);
WebSettings webSettings2 = adWebView.getSettings();
webSettings2.setJavaScriptEnabled(true);
webSettings2.setLoadWithOverviewMode(true);
webSettings2.setUseWideViewPort(true);
String qData = Title + ". " + Abstract;
String sUrl = "http://www.adrelevantis.com/revive/www/delivery/asyncmjs.php?zoneId=2&deliveryId=117dadc085810cb156b98c91b758833b&q=" + qData;
adWebView.loadUrl(sUrl);

You can get the complete Java code here.

Posted by Gary Guo on December 28, 2015