Hi folks!
Here comes another monetizing option for our apps.
Millenial Media is pretty useful to be used in similar ways like AdWhirl does. You can get ads from many different sources.
The current library only has banner ads placement. I have been trying to get the video/fullscreen ads to work, but no success so far.
Ok.. now the steps.
Online:
- Register yourself as a developer in Millenium Media
- Download the SDK from MM (the JAR file name is MMAdView.jar)
- Add an app, get the AppId
Setup:
- Download the attached libraries
- Copy all the files in the zip and the JAR from MM into your extras library folder
- Restart B4A or refresh the Libraries tab.
Code in B4A:
- select both MESMMLib and MMAdView from the libs tab.
- project > do not overwrite manifest file <--- should be selected
In your manifest File:
1 - Before </application>, add the following:
2 - For permission, make sure the following are there:
<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"/>
That's it, I think...
Please have a test and let me know how the lib performs. I believe MM has better ads and fill for EU and US markets.
Any questions, ask away!
Cheers!
Here comes another monetizing option for our apps.
Millenial Media is pretty useful to be used in similar ways like AdWhirl does. You can get ads from many different sources.
The current library only has banner ads placement. I have been trying to get the video/fullscreen ads to work, but no success so far.
Ok.. now the steps.
Online:
- Register yourself as a developer in Millenium Media
- Download the SDK from MM (the JAR file name is MMAdView.jar)
- Add an app, get the AppId
Setup:
- Download the attached libraries
- Copy all the files in the zip and the JAR from MM into your extras library folder
- Restart B4A or refresh the Libraries tab.
Code in B4A:
- select both MESMMLib and MMAdView from the libs tab.
- project > do not overwrite manifest file <--- should be selected
B4X:
Sub Globals
Dim m As MMAdViewX
End Sub
Sub Activity_Create(FirstTime As Boolean)
m.InitializeBanner("mm", <insert appid here>)
Activity.AddView(m, 0, 0, 100%x, 53dip) 'this is the size for MM
End Sub
Sub Activity_Resume
m.loadAd
End Sub
In your manifest File:
1 - Before </application>, add the following:
B4X:
<activity android:name="com.millennialmedia.android.MMAdViewOverlayActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
</activity>
<activity android:name="com.millennialmedia.android.VideoPlayer"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|keyboard" >
</activity>
2 - For permission, make sure the following are there:
<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"/>
That's it, I think...
Please have a test and let me know how the lib performs. I believe MM has better ads and fill for EU and US markets.
Any questions, ask away!
Cheers!