您的位置首页百科问答

万普平台sdk如何使用

万普平台sdk如何使用

的有关信息介绍如下:

万普平台sdk如何使用

万普世纪移动广告平台sdk主要提供万普统计、虚拟货币、积分墙、互动广告、迷你广告、插屏广告、自定义广告等功能。而我是一名万普的业余开发者,下面为大家简单分享一下万普的sdk包使用技巧。

引入万普的jar包。放在android项目的libs目录下。

给apk添加权限,以下权限添加到AndroidManifest.xml文件中。

(注:如果你不加入权限,你将无法显示万普的广告哦。)

虚拟货币接口。在应用中合理设置虚拟货币以及消费机制,可促进用户参与应用内购买或参与广告活动,增强用户粘性,大幅提升收益。

//消费虚拟货币.

AppConnect.getInstance(this).spendPoints(10, this);

//奖励虚拟货币

AppConnect.getInstance(this).awardPoints(10, this);

protected void onDestroy() {

// 释放资源,原finalize()方法名修改为close()

AppConnect.getInstance(this).close();

super.onDestroy();

}

积分墙接口。作为开发者,我们可以在应用中合适的位置加入“推荐应用”、“免费赚积分”等类似的字样的共,来获取更高的广告收益。

//显示推荐列表(软件)

AppConnect.getInstance(this).showAppOffers(this);

//显示推荐列表(游戏)

AppConnect.getInstance(this).showGameOffers(this);

团购积分墙接口。

AppConnect.getinstance(this).showTuanOffers(this);

互动广告接口。

// 互动广告调用方式

LinearLayout layout = (LinearLayout) this.findViewById(R.id.AdLinearLayout);

AppConnect.getInstance(this).showBannerAd(this, layout);

xml布局文件中的代码为:

android:id="@+id/AdLinearLayout"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:gravity="center_horizontal"

android:layout_below="@id/RelativeLayout01"/>