안드로이드 응용 프로그램에 admob을 성공적으로 통합했습니다. 하지만 나는 더 낮은 epcm과 높은 인상을 받고있다. 결과적으로 나는 많은 보수를받지 못하고 있습니다. 내 활동은 새로운 활동이 시작될 때마다로드됩니다. 나는 여기에 안드로이드의 AdMob 위치 고정
new FloatingAd(InboxListActivity.this);
을 추가 floatingad 클래스입니다 않은 : 여기
public FloatingAd(Context mContext){
Context context = mContext;
// Locate the Banner Ad in activity_main.xml
AdView adView = (AdView) ((Activity) context).findViewById(R.id.adView);
// Request for Ads
AdRequest adRequest = new AdRequest.Builder()
.build();
adView.loadAd(adRequest);
}
내 XML 코드 : 모든 onCreateView에
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad" />
가(). 그래서 새로운 활동이있을 때마다 새로운 인스턴스를 만듭니다. 이제 모든 화면에 대해 addview 상수를 만들려고합니다. 그래서 새로운 액티비티를 시작하면 add의 새로운 인스턴스를 생성하지 않을 것이다. 그것을 성취하는 방법? 내 응용 프로그램은 조각 기반이 아닌 활동 기반이라는 점에 유의하십시오.
궁금한 점은 AdView를 지속적으로 다시 만들고 어떻게 epcm을 낮 춥니 까? – Simas