AntCopp
AntCopp

Reputation: 163

Millenial Media Ads doesn't appear in Android app

Newbie of Android coding, I've published an Android app on Play Store and I'd like to monetize through Ads with Millenial Media.

Already register a new account, I followed every guides in their site, still I can't figure out why Ads won't show up in my app when launched.

The codes in attachment show just the instructions i added to my app in order to visualize mm ads.

This is my Android Manifest modified to implements MMedia Ads:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<activity android:name="com.millennialmedia.android.MMActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" 
android:configChanges="keyboardHidden|orientation|keyboard" ></activity>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" /> 

Here is MainActivity.java with codes for MMads

public class MainActivity extends Activity {

private MMAdView adViewFromXml;


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


    adViewFromXml=(MMAdView)findViewById(R.id.adView);

    MMRequest request = new MMRequest();

    adViewFromXml.setMMRequest(request);
    adViewFromXml.getAd();

And here is activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mm="http://millennialmedia.com/android/schema"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/rlLayout" >

 <!-- The android layout width and height should match the mm width and height -->
<com.millennialmedia.android.MMAdView
    android:id="@+id/adView"
    android:layout_width="320dp"
    android:layout_height="50dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    mm:width="320"
    mm:height="50"
    mm:apid="XXXXX"
    mm:refreshInterval="20"
    mm:accelerate="true"
    mm:age="30"
    mm:gender="male"

     />

I already linked my Android device to MMedia portal to receive testing ads through Device ID; I've imported the MMedia library required and integrated the MM sdk;

Still, when i launch my Android App, the Ad Banner doesn't show up. No error warning.

As guide, I've also followed this Youtube Video https://www.youtube.com/watch?v=PNQoSRI6vks

Any advice is highly appreciate. Thanks.

Upvotes: 0

Views: 325

Answers (1)

AntCopp
AntCopp

Reputation: 163

Solved: MMedia Support gave me another APID (a dummy one for test purpose), and it worked. So i assume my codes are correct.

Upvotes: 1

Related Questions