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


Java QbSdk.initX5Environment方法代码示例

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


在下文中一共展示了QbSdk.initX5Environment方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: initTencentX5

import com.tencent.smtt.sdk.QbSdk; //导入方法依赖的package包/类
private static void initTencentX5(final Context context) {
    int tbsVersion = 0;
    boolean noTencentX5 = false;
    try {
        String[] lists  = context.getAssets().list("widget");
        for (int i = 0; i < lists.length; i++) {
            if (lists[i].equalsIgnoreCase("notencentx5")) {
                noTencentX5 = true;
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    //初始化X5引擎SDK
    tbsVersion = QbSdk.getTbsVersion(context);
    if (noTencentX5 || (tbsVersion > 0 && tbsVersion < 30000)) {
        BDebug.i("AppCanTBS", "QbSdk.forceSysWebView()");
        QbSdk.forceSysWebView();
    }

    if(!QbSdk.isTbsCoreInited() && (tbsVersion == 0 || tbsVersion >= 30000) && !noTencentX5){
        final long timerCounter = System.currentTimeMillis();
        // 如果手机没有可以共享的X5内核,会先下载并安装,首次启动不会使用X5,再次启动才会使用X5;
        // 如果手机有可以共享的X5内核,但未安装,会先安装,首次启动不会使用X5,再次启动才会使用X5;
        // 如果手机有可以共享的X5内核,已经安装,首次启动会使用X5;
        QbSdk.initX5Environment(context, new QbSdk.PreInitCallback(){
            @Override
            public void onViewInitFinished(boolean success) {
                CookieSyncManager.createInstance(context);
                CookieManager.getInstance().setAcceptCookie(true);
                CookieManager.getInstance().removeSessionCookie();
                CookieManager.getInstance().removeExpiredCookie();
                float deltaTime = (System.currentTimeMillis() - timerCounter);
                BDebug.i("AppCanTBS", "success " + success + " x5初始化使用了" + deltaTime + "毫秒");
            }

            @Override
            public void onCoreInitFinished() {
                BDebug.i("AppCanTBS", "onX5CoreInitFinished!!!!");
            }
        });
    }
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:44,代码来源:WebViewSdkCompat.java

示例14: initX5Environment

import com.tencent.smtt.sdk.QbSdk; //导入方法依赖的package包/类
/**
 * 预加载腾讯X5内核,在Application的onCreate方法中调用。
 * 如果用到腾讯X5服务,必须调用此方法。
 *
 * @param appContext
 * @param callback
 */
public static void initX5Environment(Context appContext, @Nullable QbSdk.PreInitCallback callback) {
    QbSdk.initX5Environment(appContext, callback);
}
 
开发者ID:joy-inc,项目名称:core-web,代码行数:11,代码来源:JoyWeb.java


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