经过一番麻烦(帐户在 ADMOB 上罐装)和研究后,我已经让广告在我的所有 Android 应用程序中运行。这将适用于很多广告网络,但大多数会禁止您点击欺诈。只有一个网络允许这种方法,他们也提供支持。
我有 100 多个游戏应用。使用此方法实施和工作。这是其中一个的链接,供您查看它在游戏中的外观。我在其中使用多个广告来强迫用户点击并赚钱:Market
LeadBolt 是否为横幅广告提供 HTML 集成?
LeadBolt 确实允许使用 HTML 将横幅广告集成到您的应用程序中,而不是使用我们的 SDK。要在将应用程序添加到 LeadBolt 门户后创建 HTML 横幅广告,只需单击“添加广告”并从下拉框中选择“应用程序横幅 (HTML)”。然后可以将 HTML sn-p 直接添加到应用程序的 HTML 框架中。
到目前为止,我的有效每千次展示费用为 6.15 美元
我制作了这份指南以表达我的感激之情:
发布者代码:
第一步:
获取帐号:LeadBolt
第二步:
单击“APPS”选项卡和“Create New APP”以创建广告。请记住将内容解锁器更改为 HTML 横幅。在此过程中。
第三步:
获取 HTML AD 代码并确保其安全。这就是我们需要的站点。那有多简单?
AD HTML 文件:
创建一个 HTML 文件并将其加载到您的站点。请记住将上面步骤中的 HTML 代码替换为我放置的位置:*在此处输入 HTML 广告代码*
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>Untitled Document</title>
<style type="text/css">
body,td,th {
color: #FFF;
}
body {
background-color: #000;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
text-align: center;
position: relative;
}
</style>
</head>
<body>
****ENTER HTML AD CODE HERE****
</body>
</html>
动作脚本代码:
第一步:
信用:我在另一个网站上找到了这个,并想感谢 pixelpaton.com 的作者
您需要做的唯一更改是输入您的网站 html url,您将 AD HTML 文件放置在我放置的空间中:“*在此处输入完整的 HTML URL*强>”。无论您想要广告,请放置以下代码:
// imports
import flash.events.Event;
import flash.events.LocationChangeEvent;
import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.events.MouseEvent;
// setup variables
var _stageWebView:StageWebView;
var myAdvertURL:String = "****ENTER COMPLETE HTML URL HERE****";
//
{
// check that _stageWebView doersn't exist
if (! _stageWebView) {
_stageWebView = new StageWebView () ;
// set the size of the html 'window'
_stageWebView.viewPort = new Rectangle(0,0, 800, 100);
// add a listener for when the content of the StageWebView changes
_stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE,onLocationChange);
// start loading the URL;
_stageWebView.loadURL(myAdvertURL);
}
// show the ad by setting it's stage property;
_stageWebView.stage = stage;
}
function toggleAd(event:MouseEvent):void {
trace("toggling advert",_stageWebView);
// check that StageWebView instance exists
if (_stageWebView) {
trace("_stageWebView.stage:"+_stageWebView.stage);
if (_stageWebView.stage == null) {
//show the ad by setting the stage parameter
_stageWebView.stage = stage;
} else {
// hide the ad by nulling the stage parameter
_stageWebView.stage = null;
}
} else {
// ad StageWebView doesn't exist - show create it
}
}
function destroyAd(event:MouseEvent):void {
// check that the instace of StageWebView exists
if (_stageWebView) {
trace("removing advert");
// destroys the ad
_stageWebView.stage = null;
_stageWebView = null;
}
}
function onLocationChange(event:LocationChangeEvent):void {
// check that it's not our ad URL loading
if (_stageWebView.location != myAdvertURL) {
// destroy the ad as the user has kindly clicked on my ad
destroyAd(null);
// Launch a normal browser window with the captured URL;
navigateToURL( new URLRequest( event.location ) );
}
}
// setup button listeners
希望这对您有所帮助。如果您有任何问题,请告诉我。享受吧。