SlideShare a Scribd company logo
How to integrate Mobvista Ads SDK
V1.0
Introduction
This document will guide you through the integration process of the Mobvista SDK, which will
help you make money from your Android applications.
It’s time to take several minutes to integrate the Mobvista Ads SDK into your app and try smart
ads to maximize the revenue from your traffic now.
If you have any questions, contact us via publisher@mobvista.com.
Step1. Import Mobvista Ads SDK Library to Eclipse project
Unzip the “MobvistaAdsSdk” folder from the SDK zip to your workspace.
Right click on the ‘Package Explorer’ view in Eclipse and choose ‘Import’
In the ‘Import’ window, go to ‘General’ and then choose ‘Existing Projects into Workspace’.
Then click ‘Next’
In the new “Import” window, click ‘Browse’ and navigate to the unzipped mobvistaAdsSdk folder
in your workspace.
Now, your ‘Package Explorer’ should look like this (in this example, YourApp is your project):
Step2. Integrate your application with Mobvista Ads SDK
Right click on the MobvistaAdsSdk project, click on ‘Properties’ and choose ‘Android’ from the
navigation pane. Make sure that the MobvistaAdsSdk project is marked as a Library:
Add a reference to the MobvistaAdsSdk in your project:
Right click on “your project”, and choose ‘Properties’.
Choose ‘Android’ from the navigation pane.
Click ‘Add’ and choose ‘MobvistaAdsSdk from the new opened window:
Step3. Update your Manifest file
1. Under the main manifest tag, add the following permissions:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
2. Under the application tag, add new activities:
<activity android:name="com.mobvista.sdk.ad.InAppWebView"
android:configChanges="orientation|keyboardHidden|screenSize"
android:windowSoftInputMode="adjustPan" />
<activity android:name="com.mobvista.sdk.ad.RichMediaActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:windowSoftInputMode="adjustPan" />
3. Under the application tag, add your developer ID and app ID:
<meta-data android:name="mobvista.ads.sdk.apikey" android:value="your dev id"/>
<meta-data android:name="mobvista.ads.sdk.appid" android:value="your app id"/>
You can find your IDs in the developer’s portal.
Step4. Show Banner Or Text Ads
To add the Banner or Text Ads, add the following view inside your Activity layout XML:
Attribute Description
refreshtime Refresh time should be between 15 to 30
seconds, default value is 20 seconds
adtype banner or text
<com.mobvista.sdk.ad.AdView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
refreshtime="20" adtype="banner"/>
Step5 . Show FloatWall Ads
i. In your activity, create a member variable:
private FloatAdView adView = new FloatAdView(this,adListener);
Note: The parameter of adView constructor is the context (activity) and adListener
ii. Override the onPause method and add the call to adView.onPause():
@Override
public void onResume(){
super.onResume();
adView.onPause();
}
Note: Add this call right after the call to super.onPause()
iii. Override the onResume method and add the call to adView.onResume():
@Override
public void onResume(){
super.onResume();
adView.onResume();
}
Note: Add this call right after the call to super.onResume()
iv. Override the onDestroy method and add the call to adView.onDestroy():
@Override
public void onDestroy(){
super.onDestroy();
adView.onDestroy();
}
Note: Add this call right after the call to super.onDestroy()
v. Full Example :
public class FloatWallActivity extends Activity {
private FloatAdView adView;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
adView = new FloatAdView(this,adListener);
}
protected void onPause() {
super.onPause();
adView.onPause();
};
protected void onResume() {
super.onResume();
adView.onResume();
};
protected void onDestroy() {
super.onDestroy();
adView.onDestory();
}
AdListener adListener = new AdListener()
{
public void onAdError(Msg msg) {
}
public void onAdShow() {
}
public void onNoAd() {
}
public void onAdClick() {
}
public void onAdClose() {
}
};
}
Step6. Show Interstitial Ads
In your activity, please add:
SDKManager sdkManager = new SDKManager(this);
Example:
private SDKManager sdkManager;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if(sdkManager ==null)
sdkManager = new SDKManager(this);
}
Note: The parameter of sdkManager constructor is the context (activity)
Using Interstitial in your application
Mobvista’s Intersitital is comprised of the following three sub Ad Formats:
1.Dialog Overlay Ad
2.AppWall Ad
3.Full Screen Ad
1. Show the Ad in chosen places within the app
You can choose to show the interstitial ad in several locations within your application.
This could be upon entering, between stages, while waiting for an action and more.
We do, however, recommend showing the ad upon exiting the application by using the ‘back’
button or the ‘home’ button, as explained in steps 2 and 3 below.
Add the following code to the appropriate place or places within your activities in which you
would like to show the ad:
sdkManager.showOverlayAd();
sdkManager.showAppWall();
sdkManager.showFullScreenAd();
2. Show the Ad upon exit by pressing the 'back' button
Override the onBackPressed() method and add a call to the
sdkManager.showOverLayAd() or
sdkManager.showAppWall() or
sdkManager.showFullScreenAd():
@Override
public void onBackPressed() {
if(sdkManager!null){
// use only one from below
sdkManager.showOverlayAd();
sdkManager.showAppWall();
sdkManager.showFullScreenAd();
}
super.onBackPressed();
}
Note: add this call BEFORE the super.onBackPressed() call.
3. Show the Ad upon exit by pressing 'home' button
The Home button functionality can improve results and revenue.
Override the onPause() method and add a call the
sdkManager.showOverLayAd() or
sdkManager.showAppWall() or
sdkManager.showFullScreenAd():
@Override
public void onPause() {
super.onPause();
if(sdkManager!null){
// use only one from below
sdkManager.showOverlayAd();
sdkManager.showAppWall();
sdkManager.showFullScreenAd();
}
}
Add AdListener
In this SDK version we've added callback listeners for all ads, which can be called using the code
below:
sdkManager.showOverlayAd(adListener);
sdkManager.showAppWall(adListener);
sdkManager.showFullScreenAd(adListener);
AdListener adListener = new AdListener(){
public void onAdError(Msg msg) {
// This will get called if any error occurred during ad serving.
}
public void onAdShow() {
// This will be called by SDK when it’s showing any of the interstitial ad.
}
public void onNoAd() {
// This will be called by SDK when no interstitial ad.
}
public void onAdClick() {
// This will be called by SDK when the interstitial ad is click.
}
public void onAdClose() {
// This will be called by SDK when the interstitial ad is close.
}
};

More Related Content

What's hot

Android calculatortest
Android calculatortestAndroid calculatortest
Android calculatortest
Vishal Dasa Redy
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Process
wacapps
 
Abandoned carts
Abandoned cartsAbandoned carts
Abandoned carts
Netmera
 
Langkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi androidLangkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi android
Agus Haryanto
 
Build Your First Android App
Build Your First Android AppBuild Your First Android App
Build Your First Android App
Transpose Solutions Inc
 
Tutorials3
Tutorials3Tutorials3
Tutorials3
raja umair
 
7 Ways to improve your gradle build
7 Ways to improve your gradle build7 Ways to improve your gradle build
7 Ways to improve your gradle build
Tania Pinheiro
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
PushApps - Content Recommendation in Push Notifications
 
Build your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automationBuild your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automation
Winton Winton
 
實戰Facebook Marketing API
實戰Facebook Marketing API實戰Facebook Marketing API
實戰Facebook Marketing API
Yu LI
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-login
Katy Slemon
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
sivachandra mandalapu
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
Peter Friese
 
UI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsUI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms Apps
Codrina Merigo
 
Diving into VS 2015 Day4
Diving into VS 2015 Day4Diving into VS 2015 Day4
Diving into VS 2015 Day4
Akhil Mittal
 

What's hot (15)

Android calculatortest
Android calculatortestAndroid calculatortest
Android calculatortest
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Process
 
Abandoned carts
Abandoned cartsAbandoned carts
Abandoned carts
 
Langkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi androidLangkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi android
 
Build Your First Android App
Build Your First Android AppBuild Your First Android App
Build Your First Android App
 
Tutorials3
Tutorials3Tutorials3
Tutorials3
 
7 Ways to improve your gradle build
7 Ways to improve your gradle build7 Ways to improve your gradle build
7 Ways to improve your gradle build
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
 
Build your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automationBuild your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automation
 
實戰Facebook Marketing API
實戰Facebook Marketing API實戰Facebook Marketing API
實戰Facebook Marketing API
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-login
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
UI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsUI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms Apps
 
Diving into VS 2015 Day4
Diving into VS 2015 Day4Diving into VS 2015 Day4
Diving into VS 2015 Day4
 

Similar to Tang doanh thu quang cao di dong

Create New Android Activity
Create New Android ActivityCreate New Android Activity
Create New Android Activity
Transpose Solutions Inc
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...
naseeb20
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...
Sunil kumar Mohanty
 
Meteor.js Workshop by Dopravo
Meteor.js Workshop by DopravoMeteor.js Workshop by Dopravo
Meteor.js Workshop by Dopravo
ArabNet ME
 
Google admob mediation tutorial
Google admob mediation tutorialGoogle admob mediation tutorial
Google admob mediation tutorial
Rakesh Singh Parihar
 
Google admob mediation tutorial
Google admob mediation tutorialGoogle admob mediation tutorial
Google admob mediation tutorial
Indrajit Paliwal
 
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twistIntro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Lauren Hayward Schaefer
 
Getting started-with-oracle-so a-9
Getting started-with-oracle-so a-9Getting started-with-oracle-so a-9
Getting started-with-oracle-so a-9
Amit Sharma
 
How to Detect a Click Outside a React Component.pptx
How to Detect a Click Outside a React Component.pptxHow to Detect a Click Outside a React Component.pptx
How to Detect a Click Outside a React Component.pptx
BOSC Tech Labs
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
Yudep Apoi
 
Getting started-with-oracle-so a-viii
Getting started-with-oracle-so a-viiiGetting started-with-oracle-so a-viii
Getting started-with-oracle-so a-viii
Amit Sharma
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Alberto Ruibal
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
Abid Khan
 
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteMVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
Ravi Bhadauria
 
Student Developer Challenge
Student Developer ChallengeStudent Developer Challenge
Student Developer Challenge
Studentdeveloperchallenge
 
Visual Studio tool windows
Visual Studio tool windowsVisual Studio tool windows
Visual Studio tool windows
PVS-Studio
 
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
LogeekNightUkraine
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
maamir farooq
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
easychen
 
04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
Amr Elghadban (AmrAngry)
 

Similar to Tang doanh thu quang cao di dong (20)

Create New Android Activity
Create New Android ActivityCreate New Android Activity
Create New Android Activity
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...
 
Meteor.js Workshop by Dopravo
Meteor.js Workshop by DopravoMeteor.js Workshop by Dopravo
Meteor.js Workshop by Dopravo
 
Google admob mediation tutorial
Google admob mediation tutorialGoogle admob mediation tutorial
Google admob mediation tutorial
 
Google admob mediation tutorial
Google admob mediation tutorialGoogle admob mediation tutorial
Google admob mediation tutorial
 
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twistIntro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
 
Getting started-with-oracle-so a-9
Getting started-with-oracle-so a-9Getting started-with-oracle-so a-9
Getting started-with-oracle-so a-9
 
How to Detect a Click Outside a React Component.pptx
How to Detect a Click Outside a React Component.pptxHow to Detect a Click Outside a React Component.pptx
How to Detect a Click Outside a React Component.pptx
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
 
Getting started-with-oracle-so a-viii
Getting started-with-oracle-so a-viiiGetting started-with-oracle-so a-viii
Getting started-with-oracle-so a-viii
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteMVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
 
Student Developer Challenge
Student Developer ChallengeStudent Developer Challenge
Student Developer Challenge
 
Visual Studio tool windows
Visual Studio tool windowsVisual Studio tool windows
Visual Studio tool windows
 
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
 
04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
 

Recently uploaded

THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
7DFarhanaMohammed
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
RandolphRadicy
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
Taste
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
khabri85
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 

Recently uploaded (20)

THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 

Tang doanh thu quang cao di dong

  • 1. How to integrate Mobvista Ads SDK V1.0 Introduction This document will guide you through the integration process of the Mobvista SDK, which will help you make money from your Android applications. It’s time to take several minutes to integrate the Mobvista Ads SDK into your app and try smart ads to maximize the revenue from your traffic now. If you have any questions, contact us via publisher@mobvista.com. Step1. Import Mobvista Ads SDK Library to Eclipse project Unzip the “MobvistaAdsSdk” folder from the SDK zip to your workspace. Right click on the ‘Package Explorer’ view in Eclipse and choose ‘Import’ In the ‘Import’ window, go to ‘General’ and then choose ‘Existing Projects into Workspace’. Then click ‘Next’
  • 2. In the new “Import” window, click ‘Browse’ and navigate to the unzipped mobvistaAdsSdk folder in your workspace. Now, your ‘Package Explorer’ should look like this (in this example, YourApp is your project):
  • 3. Step2. Integrate your application with Mobvista Ads SDK Right click on the MobvistaAdsSdk project, click on ‘Properties’ and choose ‘Android’ from the navigation pane. Make sure that the MobvistaAdsSdk project is marked as a Library:
  • 4. Add a reference to the MobvistaAdsSdk in your project: Right click on “your project”, and choose ‘Properties’. Choose ‘Android’ from the navigation pane. Click ‘Add’ and choose ‘MobvistaAdsSdk from the new opened window: Step3. Update your Manifest file 1. Under the main manifest tag, add the following permissions: <uses-permission android:name="android.permission.INTERNET"/>
  • 5. <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> 2. Under the application tag, add new activities: <activity android:name="com.mobvista.sdk.ad.InAppWebView" android:configChanges="orientation|keyboardHidden|screenSize" android:windowSoftInputMode="adjustPan" /> <activity android:name="com.mobvista.sdk.ad.RichMediaActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:windowSoftInputMode="adjustPan" /> 3. Under the application tag, add your developer ID and app ID: <meta-data android:name="mobvista.ads.sdk.apikey" android:value="your dev id"/> <meta-data android:name="mobvista.ads.sdk.appid" android:value="your app id"/> You can find your IDs in the developer’s portal. Step4. Show Banner Or Text Ads To add the Banner or Text Ads, add the following view inside your Activity layout XML: Attribute Description refreshtime Refresh time should be between 15 to 30 seconds, default value is 20 seconds adtype banner or text <com.mobvista.sdk.ad.AdView android:layout_width="wrap_content" android:layout_height="wrap_content" refreshtime="20" adtype="banner"/>
  • 6. Step5 . Show FloatWall Ads i. In your activity, create a member variable: private FloatAdView adView = new FloatAdView(this,adListener); Note: The parameter of adView constructor is the context (activity) and adListener ii. Override the onPause method and add the call to adView.onPause(): @Override public void onResume(){ super.onResume(); adView.onPause(); } Note: Add this call right after the call to super.onPause() iii. Override the onResume method and add the call to adView.onResume(): @Override public void onResume(){ super.onResume(); adView.onResume(); } Note: Add this call right after the call to super.onResume() iv. Override the onDestroy method and add the call to adView.onDestroy(): @Override public void onDestroy(){ super.onDestroy(); adView.onDestroy(); } Note: Add this call right after the call to super.onDestroy()
  • 7. v. Full Example : public class FloatWallActivity extends Activity { private FloatAdView adView; protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); adView = new FloatAdView(this,adListener); } protected void onPause() { super.onPause(); adView.onPause(); }; protected void onResume() { super.onResume(); adView.onResume(); }; protected void onDestroy() { super.onDestroy(); adView.onDestory(); } AdListener adListener = new AdListener() { public void onAdError(Msg msg) { } public void onAdShow() { } public void onNoAd() { } public void onAdClick() { } public void onAdClose() { } }; } Step6. Show Interstitial Ads In your activity, please add:
  • 8. SDKManager sdkManager = new SDKManager(this); Example: private SDKManager sdkManager; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if(sdkManager ==null) sdkManager = new SDKManager(this); } Note: The parameter of sdkManager constructor is the context (activity) Using Interstitial in your application Mobvista’s Intersitital is comprised of the following three sub Ad Formats: 1.Dialog Overlay Ad 2.AppWall Ad 3.Full Screen Ad 1. Show the Ad in chosen places within the app You can choose to show the interstitial ad in several locations within your application. This could be upon entering, between stages, while waiting for an action and more. We do, however, recommend showing the ad upon exiting the application by using the ‘back’ button or the ‘home’ button, as explained in steps 2 and 3 below. Add the following code to the appropriate place or places within your activities in which you would like to show the ad: sdkManager.showOverlayAd(); sdkManager.showAppWall(); sdkManager.showFullScreenAd(); 2. Show the Ad upon exit by pressing the 'back' button Override the onBackPressed() method and add a call to the sdkManager.showOverLayAd() or sdkManager.showAppWall() or sdkManager.showFullScreenAd(): @Override public void onBackPressed() { if(sdkManager!null){ // use only one from below
  • 9. sdkManager.showOverlayAd(); sdkManager.showAppWall(); sdkManager.showFullScreenAd(); } super.onBackPressed(); } Note: add this call BEFORE the super.onBackPressed() call. 3. Show the Ad upon exit by pressing 'home' button The Home button functionality can improve results and revenue. Override the onPause() method and add a call the sdkManager.showOverLayAd() or sdkManager.showAppWall() or sdkManager.showFullScreenAd(): @Override public void onPause() { super.onPause(); if(sdkManager!null){ // use only one from below sdkManager.showOverlayAd(); sdkManager.showAppWall(); sdkManager.showFullScreenAd(); } } Add AdListener In this SDK version we've added callback listeners for all ads, which can be called using the code below: sdkManager.showOverlayAd(adListener); sdkManager.showAppWall(adListener); sdkManager.showFullScreenAd(adListener); AdListener adListener = new AdListener(){ public void onAdError(Msg msg) { // This will get called if any error occurred during ad serving. } public void onAdShow() { // This will be called by SDK when it’s showing any of the interstitial ad. } public void onNoAd() {
  • 10. // This will be called by SDK when no interstitial ad. } public void onAdClick() { // This will be called by SDK when the interstitial ad is click. } public void onAdClose() { // This will be called by SDK when the interstitial ad is close. } };