Amobee Werbung erscheint nicht

X

xazen

Ambitioniertes Mitglied
0
Hallo Leute,

ich versuche Amobee Werbung in eine App einzubauen. Ich habe ein Testprojekt mit einer Activity, worin nur ein Textview und direkt darunter die Werbung ist. Das Projekt gab es bei Amobee und funktioniert dementsprechend einwandfrei.

Ich habe es versucht in meiner App einzubauen, aber es kam keine Werbung. Also habe ich die Activity von der Demoin meine App rüberkopiert und von meiner App aus gestartet. Permissions sind gesetzt und die neue Activity wurde im Manifest registriert. Es erscheint aber dennoch keine Werbung. Es wird nur die TextView angezeigt.

Activity:
Code:
package de.xxx.xyz;

import com.amobee.onlineHapi.AmobeeAdView;
import com.amobee.onlineHapi.OnlineHAPI;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.LinearLayout;

public class HelloWorldActivity extends Activity {
    
    private static AmobeeAdView amobeeAdView;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        // set the main layout as current view
        setContentView(R.layout.main_test);
        
        // find the layout which to put AmobeeAdView on
        LinearLayout layout = (LinearLayout) findViewById(R.id.my_id);

        // initialize HAPI
        OnlineHAPI onlineHAPI = OnlineHAPI.getInstance(this);
        
        // create amobeeAdView once and use it every time on each configuration change
        if (amobeeAdView == null) {
            // get AmobeeAdView - Amobee modified WebView control
            // ad space, placement and format are set in the following function
            amobeeAdView = onlineHAPI.getAdView("20436", 1, "MMA_Hbanner_6_1");    
            
            // set background color
            amobeeAdView.setBackgroundColor(Color.TRANSPARENT);
            
            // set refresh interval in seconds
            amobeeAdView.setRefreshInterval(60);
            
            // disable focus on the control
            amobeeAdView.setFocusable(false);
        }

        // set new control width on configuration change
        // this must be done to align the control properly when going from portrait to landscape
        amobeeAdView.setLocation(0, 0, getWindowManager().getDefaultDisplay().getWidth(), 75); 
        
        // remove parent on configuration change
        // without doing this we will not be able 
        // to add the amobeeAdView to another layout at the next line
        LinearLayout parent = (LinearLayout)amobeeAdView.getParent();
        if (parent != null) {
            parent.removeView(amobeeAdView);
        }
        
        // add the control to the layout 
        layout.addView(amobeeAdView);
    }
}

Manifest:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="de.xxx.xyz"
      android:versionCode="8"
      android:versionName="1.6.1">
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="false" android:theme="@android:style/Theme.NoTitleBar">        
        <activity android:name="de.xazen.tictactoe.TicTacToe"
                  android:label="@string/app_name"
                  android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="de.xazen.tictactoe.Game"
              android:label="@string/game_title"
              android:screenOrientation="portrait"/>
        <activity
            android:name="de.xazen.tictactoe.HelloWorldActivity"
            android:label="hello world">
           </activity>
    </application>
    <uses-sdk android:minSdkVersion="4" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    
    <supports-screens android:resizeable="true" />
    <supports-screens android:smallScreens="true" />
    <supports-screens android:normalScreens="true" />
    <supports-screens android:largeScreens="true" />
    <supports-screens android:anyDensity="true" />
    

    
    
</manifest>

main_test:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/my_id">





<TextView 
    android:id="@+id/TextView01" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="HelloWorld" 
    android:layout_gravity="center_horizontal"
    />
</LinearLayout>
 

Ähnliche Themen

SaniMatthias
Antworten
19
Aufrufe
960
swa00
swa00
Jakogami
  • Jakogami
Antworten
2
Aufrufe
1.255
Jakogami
Jakogami
O
Antworten
15
Aufrufe
2.971
ORHUX
O
Zurück
Oben Unten