마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

애드몹 광고 설치를 하는데 이게 레이아웃에선 보이는데 에뮬에서는 나오질 않네요.

0 추천
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
             
    android:id="@+id/mainLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/appbg"
    android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto">

    <Button
         />

    <FrameLayout
        >
        
        <Spinner
             />
        
        <Spinner
             />
      
        <LinearLayout
             >
   
            <TextView
                
                />

            <TextView
                />

            <TextView
                
                 />
            
        </LinearLayout>
        
      <ListView
          
          </ListView>
 
    </FrameLayout>

     <com.google.android.gms.ads.AdView
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/mainAd"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:gravity="bottom"
        android:orientation="horizontal"
        app:adSize="BANNER"
        app:adUnitId="ca-app-pub-입력했습니다." 
        >
    </com.google.android.gms.ads.AdView>
</LinearLayout>

 

 

현재 돌아가는 메인 .java에 입력해주었구요.

매니페스트도 모두 등록했습니다. 그리고 SDK매니저 통해서 구글서비스 다운받아 라이브러리 적용도 시켰습니다.

그리고 레이아웃에서 XML에서 맨아래에 배너에 대한 레이아웃도 mainAd로 해주어서 Graphical Layout에서는

광고가 삽입된게 보이는데 지니모션 에뮬 실행해서 보면 광고가 뜨질않습니다 이유가 뭘까요;

 

 

 

개님개님 (520 포인트) 님이 2015년 3월 22일 질문
03-22 07:53:04.874: E/Ads(1655): JS: Unsafe JavaScript attempt to access frame with URL http://googleads.g.doubleclick.net/mads/gma from frame with URL http://imasdk.googleapis.com/js/core/admob/bridge_en.html#goog_222738162. Domains, protocols and ports must match.
03-22 07:53:04.874: E/Ads(1655):  (null:1)
03-22 07:53:04.874: E/Web Console(1655): Unsafe JavaScript attempt to access frame with URL http://googleads.g.doubleclick.net/mads/gma from frame with URL http://imasdk.googleapis.com/js/core/admob/bridge_en.html#goog_222738162. Domains, protocols and ports must match.
03-22 07:53:04.874: E/Web Console(1655):  at null:1
03-22 07:53:04.878: I/Ads(1655): Ad finished loading.
03-22 07:53:06.022: E/Ads(1655): JS: Unsafe JavaScript attempt to access frame with URL http://googleads.g.doubleclick.net/mads/gma from frame with URL https://www.youtube.com/embed/?el=adunit&controls=0&html5=1&playsinline=1&showinfo=0&enablejsapi=1&origin=http%3A%2F%2Fimasdk.googleapis.com. Domains, protocols and ports must match.
03-22 07:53:06.022: E/Ads(1655):  (null:1)
03-22 07:53:06.022: E/Web Console(1655): Unsafe JavaScript attempt to access frame with URL http://googleads.g.doubleclick.net/mads/gma from frame with URL https://www.youtube.com/embed/?el=adunit&controls=0&html5=1&playsinline=1&showinfo=0&enablejsapi=1&origin=http%3A%2F%2Fimasdk.googleapis.com. Domains, protocols and ports must match.
03-22 07:53:06.022: E/Web Console(1655):  at null:1
03-22 07:53:08.106: W/GAV4(1655): Thread[GAThread,5,main]: Service unavailable (code=1), will retry.
03-22 07:53:13.106: W/GAV4(1655): Thread[Service Reconnect,5,main]: Service unavailable (code=1), using local store.
위에는 로그캣 내용입니다. 그리고
    public void onCreate(Bundle savedInstanceState) {
       
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
   
          interstitial = new InterstitialAd(this);
          interstitial.setAdUnitId("ca-app-pub-입력했습니다 번호");
          
          AdRequest request = new AdRequest.Builder().build();
          interstitial.loadAd(request);
          adView = (AdView)findViewById(R.id.mainAd);
          AdRequest adRequest = new AdRequest.Builder().build();
          
          adView.loadAd(adRequest);
          
          interstitial.show();

        dayOfWeek();
        func_spinner();
        copyDB();
        init();
       
    }

메인 java 내용입니다.

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...