Mobclix advertising and Android - guide

Monkey Targets Forums/Android/Mobclix advertising and Android - guide

pantson(Posted 2011) [#1]
Heres a quick guide to add mobclix ads to your android app

Create an ad app


Download the SDK


1)
Upload mobclix.jar to .build\android\libs

2)
Your Android manifest file (.build\android\AndroidManifest.xml)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="com.monkey"
	android:versionCode="1"
	android:versionName="1.0">
	<uses-sdk 
		android:minSdkVersion="7"
		android:targetSdkVersion="7" />
	<application android:label="Monkey Game" android:icon="@drawable/icon">
		<activity
			android:name="MonkeyGame" 
			android:label="Monkey Game"
			android:screenOrientation="portrait"
			android:configChanges="keyboardHidden|orientation"
			android:theme=\"@...;
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>

	    <!-- Mobclix Required Parameter -->
		<meta-data android:name="com.mobclix.APPLICATION_ID" android:value="UNIT_ID"/>
		<activity android:name="com.mobclix.android.sdk.MobclixBrowserActivity"
			android:theme=\"@..." />

	      	</application>
	<!-- Mobclix Required Permissions -->
	<uses-permission android:name="android.permission.INTERNET"></uses-permission>
	<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>

	<!-- Mobclix Optional Permissions -->
	<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:required="false"></uses-permission>
	<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:required="false"></uses-permission>
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
</manifest>

Replace UNIT_ID with the ad ID from the above screenshot

3)
Your layout file (.build\android\res\layout\main.xml)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"

	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="vertical" >




	<view class="com.monkey.MonkeyGame$MonkeyView"
    	android:id="@+id/monkeyview"
		android:keepScreenOn="true"
  		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		/>

	    <com.mobclix.android.sdk.MobclixMMABannerXLAdView
	        android:id="@+id/advertising_banner_view"
	        android:layout_height="50dp"
	        android:layout_width="320dp"
	        android:layout_gravity="center"
            android:layout_alignParentBottom="true"
	        android:tag="adspace"
	    />

</RelativeLayout>


Now you will have to setup you advertising in you mobclix account. This means joining lots of different networks (through mobclix) and/or creating custom ads


pantson(Posted 2011) [#2]
I'm experimenting with different ad providers.. so testing mobclix now.
update to main.xml
	    <com.mobclix.android.sdk.MobclixMMABannerXLAdView
	        android:id="@+id/advertising_banner_view"
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
	        android:layout_gravity="center"
            android:layout_alignParentBottom="true"
	        android:tag="adspace"
	    />



matty(Posted 2011) [#3]
Thanks, that should come in useful.

from Matt


Xaron(Posted 2012) [#4]
Cool! As Mobclix seems to be available for all platforms I just wonder how this works at all?

I mean they route different ad networks through their server or what? How much do they charge or keep from the revenue?


pantson(Posted 2012) [#5]
I've moved away from Mobclix. I wasn't getting very good return results. only ads for Wonga (finance company in UK wanting to give loans). Wasn't the advertising image I was after unfortunately.

I'm now back using Admob with in house advertising too.


Xaron(Posted 2012) [#6]
Thanks for that info. What is that in house advertising?


pantson(Posted 2012) [#7]
you can create your own banners or text ads and have them appear in your ad area across multiple apps for a period of time.

I use it to point to our customers websites (and mine and gfx artist too)
I also used it to point to the Xmas version of the CloneZoo for the Decemeber period
You could use it to point to your other apps too

You can state
- text or graphic
- frequency
- advertising period
- url (http or marketplace)
- which apps to show on


Xaron(Posted 2012) [#8]
Ah now that's a nice feature, thanks Rich!


Zurrr(Posted 2012) [#9]
I found a good review for Mobclix

http://www.projectjourneyman.com/android-ad-revenue-mobclix-admob


benmc(Posted 2012) [#10]
@magic The first comment on that review is over a year old. He's updated the article at the link below specifying that he's since moved to other ad networks.

http://www.projectjourneyman.com/admob-vs-mobclix-getting-paid


slenkar(Posted 2013) [#11]
here is the java code to get a banner shown



import com.mobclix.android.sdk.MobclixAdView;
import com.mobclix.android.sdk.MobclixMMABannerXLAdView;


class BBMobclix implements Runnable{

static MobclixAdView _adview;
static BBMobclix inst;
static Activity _activity;

public void run(){


_activity=BBAndroidGame.AndroidGame().GetActivity();



_adview=new MobclixMMABannerXLAdView(_activity);
RelativeLayout parent=(RelativeLayout)_activity.findViewById( R.id.mainLayout );
parent.addView( _adview);


}

static public void go(){
inst=new BBMobclix();
BBAndroidGame.AndroidGame().GetGameView().post( inst );

}
}