• Tutorials
  • Tips & Tricks
  • Applications
  • News

Android Trainee

  • Tutorials
  • Tips & Tricks
  • Applications
  • News
Home  /  Tutorials  /  How to implement mobfox Ads In Android Application?
20 February 2015

How to implement mobfox Ads In Android Application?

Written by admin@androidtrainee
Tutorials Advertising Networks, android, android ads, Android App, mobfox Leave a Comment

About :-Earn up to five times your banner eCPM and improve your app’s user experience by implementing high-performing, fully customizable native ads from MobFox.

 

Platform :-

  • Android
  • iOS

Payment Method & Terms :-

 

  • Wire Transfer
  • Paypal

We pay out publishers based on eCPM, which is calculated by the inventory’s CTR and amount impressions. We pay publishers NET60 day payment terms. All invoices can be found on the platform under My Account > My Publisher Payments.

 

—> Frist Open mobfox Account And Get Key.

After Getting All Information  Start Eclipse And Create New Project.

 

For ad google_play_services import project from the J:\android-sdk-windows\extras\google\google_play_services\libproject

 

—>  AndroidManifest.xml

 


<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.ACCESS_FINE_LOCATION" />

 

<activity
android:name="com.adsdk.sdk.banner.InAppWebView"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity
android:name="com.adsdk.sdk.video.RichMediaActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:hardwareAccelerated="false" />
<activity
android:name="com.adsdk.sdk.mraid.MraidBrowser"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>

 

–> For Banner Ads Open Layout.xml File.


<com.adsdk.sdk.banner.AdView
android:id="@+id/mobFoxView"
android:layout_width="300dp"
android:background="#000000"
android:layout_height="50dp"
request_url="http://my.mobfox.com/request.php"
location="true"
animation="true"
publisherId="e09a2fc1b0cef0df7442f7cb41225735"

adspaceStrict="true"
adspaceHeight="50"
adspaceWidth="320"
/>

 

open MyActivity.java file…


import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;

import com.adsdk.sdk.Ad;
import com.adsdk.sdk.AdListener;
import com.adsdk.sdk.AdManager;
import com.adsdk.sdk.Gender;

public class MainActivity extends Activity implements AdListener {

private AdManager mManager;

public void onClickShowVideoInterstitial(View v) {
mManager.requestAd();
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mManager = new AdManager(this,"http://my.mobfox.com/request.php",
"e09a2fc1b0cef0df7442f7cb41225735", true);

mManager.setInterstitialAdsEnabled(true); //enabled by default. Allows the SDK to request static interstitial ads.
mManager.setVideoAdsEnabled(true); //disabled by default. Allows the SDK to request video fullscreen ads.
mManager.setPrioritizeVideoAds(true); //disabled by default. If enabled, indicates that SDK should request video ads first, and only if there is no video request a static interstitial (if they are enabled).

ArrayList<String> keywords = new ArrayList<String>();
keywords.add("cars");
keywords.add("money");
mManager.setKeywords(keywords); //optional, to send list of keywords (user interests) to ad server.
mManager.setUserAge(37); //optional, sends user's age
mManager.setUserGender(Gender.FEMALE); //optional, sends user's gender

mManager.setListener(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

public void adClicked() {
Toast.makeText(MainActivity.this, "Ad clicked!", Toast.LENGTH_LONG)
.show();
}

public void adClosed(Ad arg0, boolean arg1) {
Toast.makeText(MainActivity.this, "Ad closed!", Toast.LENGTH_LONG)
.show();
}

public void adLoadSucceeded(Ad arg0) {
Toast.makeText(MainActivity.this, "Ad load succeeded!", Toast.LENGTH_LONG)
.show();
if (mManager != null && mManager.isAdLoaded())
mManager.showAd();
}

public void adShown(Ad arg0, boolean arg1) {
Toast.makeText(MainActivity.this, "Ad shown!", Toast.LENGTH_LONG)
.show();
}

public void noAdFound() {
Toast.makeText(MainActivity.this, "No ad found!", Toast.LENGTH_LONG)
.show();
}

@Override
protected void onDestroy() {
super.onDestroy();
mManager.release();

}
}

 

 

—> Run Your Code.

mobfox2 mobfox1

 

admin@androidtrainee

 Previous Article How to implement AppBrain AppLift Ads In Android Application?
Next Article   How to implement AirPush Ads In Android Application?

Related Posts

  • Android New Quick Action Animation.

    July 15, 2015
  • Android satellite menu Animation.

    July 15, 2015
  • Android Staggered Grid & List View.

    July 14, 2015

Leave a Reply

Cancel reply

Tags

admob Advertising Networks AerServ Airpush android android ads android Advertising Networks Android App android chart animation Android GridView android L android lollipop androidmapv2 AppBrain AppFlood Appia AppKey Appnext AppOptim Appwiz chart chartview Epom Market google place api GridView Image Loader InMobi LeadBolt location map mapv2 mapv2 api material design Minimob Mobicow MobileCore MobiMicro NativeX Pingjam RevMob StarApplication startapp TapContext touched location Widdit

Count per Day

  • 347Reads yesterday:
  • 463819Total visitors:
  • 39Visitors today:
  • 2412Visitors per month:
  • 1Visitors currently online:
© Copyright 2014. Theme by BloomPixel.
Posting....