| | |
| | | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; |
| | | import com.nostra13.universalimageloader.core.assist.QueueProcessingType; |
| | | import com.qq.e.comm.managers.GDTADManager; |
| | | import com.qq.e.comm.managers.GDTAdSdk; |
| | | import com.qq.e.comm.util.GDTLogger; |
| | | import com.tencent.mm.opensdk.constants.ConstantsAPI; |
| | | import com.tencent.mm.opensdk.openapi.IWXAPI; |
| | | import com.tencent.mm.opensdk.openapi.WXAPIFactory; |
| | |
| | | import androidx.multidex.MultiDex; |
| | | |
| | | |
| | | |
| | | public class BeibeiVideoApplication extends Application { |
| | | |
| | | private final static String TAG = BeibeiVideoApplication.class.getName(); |
| | |
| | | |
| | | public static BeibeiVideoApplication getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | //兼容4.4以下版本 |
| | | protected void attachBaseContext(Context newBase) { |
| | | super.attachBaseContext(newBase); |
| | | MultiDex.install(this); |
| | | } |
| | | |
| | | private static Handler handler = new Handler() { |
| | |
| | | application = this; |
| | | instance = this; |
| | | MultiDex.install(this); |
| | | if (UserUtil.isAgreeUserProtocol(this)||BeibeiConstant.IS_TEST) { |
| | | if (UserUtil.isAgreeUserProtocol(this) || BeibeiConstant.IS_TEST) { |
| | | //如果同意了用户协议 |
| | | init(application); |
| | | } |
| | |
| | | public static void init(final Application application) { |
| | | //友盟初始化 |
| | | String description = ManifestDataUtil.getAppMetaData(application, "UMENG_CHANNEL"); |
| | | UMConfigure.init(application, application.getResources().getString(R.string.umeng_key), description, UMConfigure.DEVICE_TYPE_PHONE, null); |
| | | try { |
| | | UMConfigure.setLogEnabled(true); |
| | | UMConfigure.init(application, application.getResources().getString(R.string.umeng_key), description, UMConfigure.DEVICE_TYPE_PHONE, null); |
| | | } catch (Throwable e) { |
| | | |
| | | } |
| | | // 选用AUTO页面采集模式 |
| | | MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); |
| | | UMShareAPI.get(application); |
| | |
| | | PlatformConfig.setSinaWeibo(BeibeiConstant.SINA_ID, BeibeiConstant.SINA_KEY, "http://sns.whalecloud.com/sina2/callback"); |
| | | |
| | | ImageLoader.getInstance().init(buildDefaultILC(application)); |
| | | // initX5(); |
| | | initCSJAd(application); |
| | | GDTADManager.getInstance().initWith(application, BeibeiConstant.GDT_ID); |
| | | //TODO 广点通广告初始化 |
| | | try { |
| | | GDTAdSdk.init(application, BeibeiConstant.GDT_ID); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | initWX(application); |
| | | initTaoKe(application); |
| | | |
| | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | Intent intent = new Intent(application, PushOpenClickActivity.class); |
| | | intent.putExtra("activity", "test"); |
| | | JSONObject params = new JSONObject(); |
| | | try { |
| | | params.put("id", "123123"); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | intent.putExtra("params", params.toString()); |
| | | String uriString = intent.toUri(Intent.URI_INTENT_SCHEME); |
| | | Log.i(TAG, uriString); |
| | | } |
| | | |
| | | |