当前位置: 首页>>代码示例>>Java>>正文


Java QbSdk类代码示例

本文整理汇总了Java中com.tencent.smtt.sdk.QbSdk的典型用法代码示例。如果您正苦于以下问题:Java QbSdk类的具体用法?Java QbSdk怎么用?Java QbSdk使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QbSdk类属于com.tencent.smtt.sdk包,在下文中一共展示了QbSdk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes();
        localLayoutParams.flags = (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | localLayoutParams.flags);
    }
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    QbSdk.initX5Environment(this, null);
    init();
    setViewPager();
    setNavigationView();
    setBackGround();
    setReceiver();
}
 
开发者ID:SirLYC,项目名称:Android-Gank-Share,代码行数:17,代码来源:MainActivity.java

示例2: initApplication

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
private void initApplication() {
        //初始化日志
        Logger.init(getPackageName()).hideThreadInfo();

        //初始化错误收集
//        CrashHandler.init(new CrashHandler(getApplicationContext()));
        initBugly();

        //初始化内存泄漏检测
        LeakCanary.install(App.getInstance());

        //初始化过度绘制检测
        BlockCanary.install(getApplicationContext(), new AppBlockCanaryContext()).start();

        //初始化tbs x5 webview
        QbSdk.allowThirdPartyAppDownload(true);
        QbSdk.initX5Environment(getApplicationContext(), QbSdk.WebviewInitType.FIRSTUSE_AND_PRELOAD, new QbSdk.PreInitCallback() {
            @Override
            public void onCoreInitFinished() {
            }

            @Override
            public void onViewInitFinished(boolean b) {
            }
        });
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:InitializeService.java

示例3: initHybrid

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
private void initHybrid() {
    // 初始化WebView池
    WebViewPool.getInstance().initWebViewPool(getApplicationContext());

    // 初始化x5内核
    QbSdk.initX5Environment(getApplicationContext(), new QbSdk.PreInitCallback() {
        @Override
        public void onCoreInitFinished() {
            Log.i("initX5Environment", "x5 core init finished.");
        }

        @Override
        public void onViewInitFinished(boolean b) {
            Log.i("initX5Environment", "x5 view has " + (b ? "" : "not") + " finished.");
        }
    });
}
 
开发者ID:snailycy,项目名称:AndroidHybridLib,代码行数:18,代码来源:App.java

示例4: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {

        @Override
        public void onViewInitFinished(boolean arg0) {
            // TODO Auto-generated method stub
            //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
            Log.d("app", " onViewInitFinished is " + arg0);
        }

        @Override
        public void onCoreInitFinished() {
            // TODO Auto-generated method stub
        }
    };
    //x5内核初始化接口
    QbSdk.initX5Environment(getApplicationContext(), cb);
    changeLanguage(this);
}
 
开发者ID:Yuanhongliang,项目名称:HLOLI,代码行数:22,代码来源:App.java

示例5: initX5Environment

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
/**
 * x5内核初始化接口
 */
private void initX5Environment() {
    //搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。
    QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
        @Override
        public void onViewInitFinished(boolean arg0) {
            //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
            LogUtils.e("myApplication", " onViewInitFinished is " + arg0);
        }

        @Override
        public void onCoreInitFinished() {
        }
    };
    //x5内核初始化接口
    QbSdk.initX5Environment(getApplicationContext(), cb);
}
 
开发者ID:jianesrq0724,项目名称:UpdateLibrary,代码行数:20,代码来源:MyApplication.java

示例6: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
        @Override
        public void onCoreInitFinished() {
            Log.d("MainApplication", "x5 core load success");
            Toast.makeText(MyApplication.this, "x5 core load success", Toast.LENGTH_SHORT).show();

        }

        @Override
        public void onViewInitFinished(boolean b) {

        }
    });
}
 
开发者ID:androidDaniel,项目名称:riched_editor_x5,代码行数:18,代码来源:MyApplication.java

示例7: drawChild

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
    boolean ret = super.drawChild(canvas, child, drawingTime);
    canvas.save();
    Paint paint = new Paint();
    paint.setColor(0x7fff0000);
    paint.setTextSize(24.f);
    paint.setAntiAlias(true);
    if (getX5WebViewExtension() != null) {
        canvas.drawText(this.getContext().getPackageName() + "-pid:"
                + android.os.Process.myPid(), 10, 50, paint);
        canvas.drawText(
                "X5  Core:" + QbSdk.getTbsVersion(this.getContext()), 10,
                100, paint);
    } else {
        canvas.drawText(this.getContext().getPackageName() + "-pid:"
                + android.os.Process.myPid(), 10, 50, paint);
        canvas.drawText("Sys Core", 10, 100, paint);
    }
    canvas.drawText(Build.MANUFACTURER, 10, 150, paint);
    canvas.drawText(Build.MODEL, 10, 200, paint);
    canvas.restore();
    return ret;
}
 
开发者ID:banwenmang,项目名称:X5web,代码行数:25,代码来源:X5WebView.java

示例8: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {

        @Override
        public void onViewInitFinished(boolean b) {
            //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
            Log.d("app", " onViewInitFinished is " + b);
        }

        @Override
        public void onCoreInitFinished() {
            // TODO Auto-generated method stub
        }
    };

    //x5内核初始化接口
    QbSdk.initX5Environment(getApplicationContext(), cb);
}
 
开发者ID:banwenmang,项目名称:X5web,代码行数:22,代码来源:App.java

示例9: X5WebViewEngine

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
/** Used when created via reflection. */
public X5WebViewEngine(Context context, CordovaPreferences preferences) {
  if(!isInit)
  {
    QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {

      @Override
      public void onViewInitFinished(boolean arg0) {
      }

      @Override
      public void onCoreInitFinished() {
        isInit = true;
      }
    };
    QbSdk.initX5Environment(context,  cb);
  }

  this.preferences = preferences;
  this.webView = new X5WebView(context);
  cookieManager = new X5CookieManager(webView);
}
 
开发者ID:Im-Kevin,项目名称:cordova.plugins.X5WebView,代码行数:23,代码来源:X5WebViewEngine.java

示例10: initQbSdk

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
private void initQbSdk() {
    try {
        QbSdk.allowThirdPartyAppDownload(true);
        QbSdk.initX5Environment(getApplicationContext(), QbSdk.WebviewInitType.FIRSTUSE_AND_PRELOAD, new QbSdk.PreInitCallback() {
            @Override
            public void onCoreInitFinished() {

            }

            @Override
            public void onViewInitFinished(boolean b) {

            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:godblessyouandme,项目名称:appFirst,代码行数:19,代码来源:AppContext.java

示例11: getWebViewKernelInfo

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
public String getWebViewKernelInfo() {
    KernelInfoVO infoVO = new KernelInfoVO();
    if (getX5WebViewExtension() != null) {
        infoVO.setKernelType("X5");
        infoVO.setKernelVersion(QbSdk.getTbsVersion(this.getContext()) + "");
    } else {
        if (Build.VERSION.SDK_INT > 18) {
            infoVO.setKernelType("System(Blink)");
            try {
                PackageManager pm = this.getContext().getPackageManager();
                PackageInfo pinfo = pm.getPackageInfo("com.google.android.webview",
                        PackageManager.GET_CONFIGURATIONS);
                infoVO.setKernelVersion(pinfo.versionName);
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }
        } else {
            infoVO.setKernelType("System(Webkit)");
        }
    }
    String info = DataHelper.gson.toJson(infoVO);
    return info;
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:24,代码来源:ACEWebView.java

示例12: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    //增加这句话
    QbSdk.initX5Environment(this,null);
    ExceptionHandler.getInstance().initConfig(this);
}
 
开发者ID:ZhongXiaoHong,项目名称:superFileView,代码行数:8,代码来源:App.java

示例13: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if (LeakCanary.isInAnalyzerProcess(this)) {
        // This process is dedicated to LeakCanary for heap analysis.
        // You should not init your app in this process.
        return;
    }
    LeakCanary.install(this);
    // Normal app init code...



    QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {

        @Override
        public void onViewInitFinished(boolean arg0) {
            // TODO Auto-generated method stub
            //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
            Log.d("app", " onViewInitFinished is " + arg0);


        }

        @Override
        public void onCoreInitFinished() {
            // TODO Auto-generated method stub
        }
    };
    //x5内核初始化接口
    QbSdk.initX5Environment(getApplicationContext(),  cb);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:34,代码来源:App.java

示例14: onCreate

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    instance = this;

    //初始化日志
    Logger.init(getPackageName()).hideThreadInfo();

    //初始化tbs x5 webview
    QbSdk.allowThirdPartyAppDownload(true);
    QbSdk.initX5Environment(getApplicationContext(), QbSdk.WebviewInitType.FIRSTUSE_AND_PRELOAD, null);
}
 
开发者ID:a396901990,项目名称:Article-Comment,代码行数:13,代码来源:App.java

示例15: drawChild

import com.tencent.smtt.sdk.QbSdk; //导入依赖的package包/类
@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
    	//Debug使用,用于在debug时在页面呈现内核类型和版本
            	boolean ret = super.drawChild(canvas, child, drawingTime);
        if (WDataManager.sRootWgt==null){
            return ret;
        }
    	int debug = WDataManager.sRootWgt.m_appdebug;
    	if (debug == 1&& BDebug.DEBUG) {
        		canvas.save();
        		Paint paint = new Paint();
        		paint.setColor(0x7fff0000);
        		paint.setTextSize(24.f);
        		paint.setAntiAlias(true);
        		if (getX5WebViewExtension() != null) {
            			canvas.drawText(this.getContext().getPackageName() + "-pid:"
                    					+ android.os.Process.myPid(), 10, 50, paint);
            			canvas.drawText(
                    					"X5  Core:" + QbSdk.getTbsVersion(this.getContext()),
                    					10, 100, paint);
            		} else {
            			canvas.drawText(this.getContext().getPackageName() + "-pid:"
                    					+ android.os.Process.myPid(), 10, 50, paint);
            			canvas.drawText("Sys Core", 10, 100, paint);
            		}
        		canvas.drawText(Build.MANUFACTURER, 10, 150, paint);
        		canvas.drawText(Build.MODEL, 10, 200, paint);
        		canvas.restore();
        	}
    	return ret;
    }
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:32,代码来源:ACEWebView.java


注:本文中的com.tencent.smtt.sdk.QbSdk类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。