AirPushに新規登録しました。バンドル SDK をアプリに統合しました。初めてテストしたとき、いくつかの印象を受けました。また、ダッシュボードに 2 つのインプレッションが表示されます。
現在、インプレッションを取得できません。開発チームに連絡しましたが、役に立ちませんでした。
MainActivity の私のコードは次のようになります。
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// MMSDK.initialize(this);
// setup a new adView and initialize an adRequest to it.
setupAirPushAdView();
}
@Override
public void onResume() {
super.onResume();
if ((getResources().getConfiguration().screenLayout
& Configuration.SCREENLAYOUT_SIZE_MASK)
== Configuration.SCREENLAYOUT_SIZE_SMALL) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
try {
if (!appStarted) {
setContentView(R.layout.main);
appStarted = true;
}
} catch (Exception e) {
Toast.makeText(this, e.getMessage() + "\n" + e.getClass().toString() + "\n" + e.getLocalizedMessage() + "\n", Toast.LENGTH_LONG).show();
}
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
perform();
}
}, 2000);
}
private void perform() {
setContentView(R.layout.app_home);
if (!appStarted) {
// attachAdView();
attachAirPushAdView();
appStarted = true;
}
...
その他の方法 :
private void setupAirPushAdView() {
ma = new MA(this, null, false);
airPushAdView = new AdView(this, AdView.BANNER_TYPE_IN_APP_AD, AdView.PLACEMENT_TYPE_INTERSTITIAL, false, false,
AdView.ANIMATION_TYPE_LEFT_TO_RIGHT);
}
private void attachAirPushAdView() {
LinearLayout outerAdLayout = (LinearLayout) findViewById(R.id.externalAdId);
outerAdLayout.addView(airPushAdView);
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<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" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-sdk android:minSdkVersion="9"/>
<!-- android:theme="@android:style/Theme.DeviceDefault.Light" -->
<!-- android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" -->
<application android:theme="@style/AppTheme" android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<activity android:name="MainActivity"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="nosensor"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="differential_activity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="nosensor"
>
</activity>
<activity android:name="integral_activity"
android:screenOrientation="portrait"
>
</activity>
<activity android:name="equation_activity"
android:screenOrientation="portrait"
>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<!-- android:configChanges="keyboardHidden|orientation"
android:screenOrientation="nosensor" -->
<!-- for all activities -->
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="com.gyesa.keanp176500.APPID" android:value="206488" />
<meta-data android:name="com.gyesa.keanp176500.APIKEY" android:value="android*1392147786176500813"/>
<activity android:exported="false" android:name="com.gyesa.keanp176500.AdActivity"
android:configChanges="orientation|screenSize"
android:theme="@android:style/Theme.Translucent" />
<activity android:name="com.gyesa.keanp176500.BrowserActivity"
android:configChanges="orientation|screenSize" />
<activity android:name="com.gyesa.keanp176500.VActivity"
android:configChanges="orientation|screenSize" android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<service android:name="com.gyesa.keanp176500.LService" android:exported="false"></service>
<receiver android:name="com.gyesa.keanp176500.BootReceiver" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.microphone" android:required="false" />
</manifest>