简体   繁体   English

Airpush新的AirPlay 1.0 SDK集成

[英]Airpush new AirPlay 1.0 SDK Intergration

I've been trying to add AirPush's new SDK but the ads are not showing(Smartwall). 我一直在尝试添加AirPush的新SDK,但广告没有展示(智能墙)。 I've successfully complied the apk but no results whatsoever. 我已经成功地编译了apk,但是没有任何结果。

Here is the main java file.. Please have a look and tell me what's wrong ? 这是主要的Java文件。请看一下,告诉我怎么了?

package com.testappap;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.view.KeyEvent;
import android.widget.Toast;


import com.zjxyo.erteehrt.AdCallbackListener;  //Add import statements
import com.zjxyo.erteehrt.AirPlay;


public class testappap extends Activity {
    /** Called when the activity is first created. */
    private WebView mWebView;
    private AirPlay airPlay; // AirPlay 

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mWebView = (WebView)findViewById(R.id.webView);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.setWebChromeClient(new WebChromeClient());
        mWebView.loadUrl("http://www.google.com/");
        if(airPlay==null)
            airPlay=new AirPlay(null, null, false);
            airPlay.startSmartWallAd();
    }

    @Override
    protected void onPause() {
        super.onPause();
        if(airPlay!=null)
            airPlay.startSmartWallAd();
    }

    @Override   public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
            mWebView.goBack();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }}

airPlay=new AirPlay(null, null, false); airPlay = new AirPlay(null,null,false);

First parameter cann't be null. 第一个参数不能为null。 their sdk requires Activity reference as a first parameter. 他们的SDK需要使用Activity引用作为第一个参数。

check this: http://manage.airpush.com/docs/index.php?title=AirSDK_1.0_for_Play_Store_Documentation#Step_3_-_Editing_Your_Main_File 检查以下内容: http : //manage.airpush.com/docs/index.php?title=AirSDK_1.0_for_Play_Store_Documentation#Step_3 _-_ Editing_Your_Main_File

please use this: 请使用此:

airPlay=new AirPlay(this, null, false); airPlay = new AirPlay(this,null,false);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM