| | |
| | | import com.google.gson.JsonArray; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | | import com.tencent.smtt.sdk.QbSdk; |
| | | |
| | | |
| | | import org.json.JSONException; |
| | |
| | | */ |
| | | public class app extends Application implements IAYExamListener { |
| | | |
| | | private static final String TAG = "app"; |
| | | private static final String TAG = "JiaKaoApplication"; |
| | | private static Context appContext=null; |
| | | @Override |
| | | public void onCreate() { |
| | |
| | | |
| | | //考试状态 ,一些初始状态,app一些状态应该先初始化一下 |
| | | initData(); |
| | | |
| | | QbSdk.initX5Environment(this,cb); |
| | | |
| | | } |
| | | |
| | | } |
| | | QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() { |
| | | @Override |
| | | public void onViewInitFinished(boolean arg0) { |
| | | MyLog.i(" QbSdk onViewInitFinished is " + arg0); |
| | | } |
| | | |
| | | @Override |
| | | public void onCoreInitFinished() { |
| | | MyLog.i("x5内核onCoreInitFinished"); |
| | | } |
| | | }; |
| | | private void preinitX5WebCore() { |
| | | if (!QbSdk.isTbsCoreInited()) { |
| | | // preinit只需要调用一次,如果已经完成了初始化,那么就直接构造view |
| | | QbSdk.preInit(this, null);// 设置X5初始化完成的回调接口 |
| | | MyLog.i(" QbSdk isTbsCoreInited " ); |
| | | } |
| | | } |
| | | private void initData() { |
| | | CThreadPoolExecutor.runInBackground(()->{ |
| | | int type = WorkRoomDataBase.getWorkRoomDataBase(getApplicationContext()).getExamStatusDao().getStartExamInt(); |
| | |
| | | @Override |
| | | public void callBackMsg(final int cmd, String json) { |
| | | String strConent = String.format("收到命令[%d],Json内容为%s", cmd, json); |
| | | Log.i(TAG,strConent); |
| | | if (strConent.equalsIgnoreCase(lastStr)){ |
| | | |
| | | }else{ |