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


Java MultiDex类代码示例

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


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

示例1: onBaseContextAttached

import android.support.multidex.MultiDex; //导入依赖的package包/类
/**
 * install multiDex before install tinker
 * so we don't need to put the tinker lib classes in the main dex
 *
 * @param base
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public void onBaseContextAttached(Context base) {
    super.onBaseContextAttached(base);
    sContext = getApplication();
    //you must install multiDex whatever tinker is installed!
    MultiDex.install(base);

    TinkerManager.setTinkerApplicationLike(this);

    TinkerManager.initFastCrashProtect();
    //should set before tinker is installed
    TinkerManager.setUpgradeRetryEnable(true);

    //optional set logIml, or you can use default debug log
    TinkerInstaller.setLogIml(new MyLogImp());
    //installTinker after load multiDex
    //or you can put com.tencent.tinker.** to main dex
    TinkerManager.installTinker(this);
    Tinker tinker = Tinker.with(getApplication());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:AndroidApplication.java

示例2: onBaseContextAttached

import android.support.multidex.MultiDex; //导入依赖的package包/类
/**
 * install multiDex before install tinker
 * so we don't need to put the tinker lib classes in the main dex
 *
 * @param base
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public void onBaseContextAttached(Context base) {
    super.onBaseContextAttached(base);
    //you must install multiDex whatever tinker is installed!
    MultiDex.install(base);

    SampleApplicationContext.application = getApplication();
    SampleApplicationContext.context = getApplication();
    TinkerManager.setTinkerApplicationLike(this);

    TinkerManager.initFastCrashProtect();
    //should set before tinker is installed
    TinkerManager.setUpgradeRetryEnable(true);

    //optional set logIml, or you can use default debug log
    TinkerInstaller.setLogIml(new MyLogImp());

    //installTinker after load multiDex
    //or you can put com.tencent.tinker.** to main dex
    TinkerManager.installTinker(this);
    Tinker tinker = Tinker.with(getApplication());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:30,代码来源:SampleApplicationLike.java

示例3: onBaseContextAttached

import android.support.multidex.MultiDex; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public void onBaseContextAttached(Context base) {
    super.onBaseContextAttached(base);
    //you must install multiDex whatever tinker is installed!
    MultiDex.install(base);

    SampleApplicationContext.application = getApplication();
    SampleApplicationContext.context = getApplication();
    TinkerManager.setTinkerApplicationLike(this);

    TinkerManager.initFastCrashProtect();
    TinkerManager.setUpgradeRetryEnable(true);

    TinkerInstaller.setLogIml(new MyLogImp());

    TinkerManager.installTinker(this);
}
 
开发者ID:xingstarx,项目名称:TinkerDemo,代码行数:19,代码来源:BaseApplicationLike.java

示例4: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_rtc_conference_config);

    setTitle(R.string.rtc_only);

    mCodecRadioGroup = (RadioGroup) findViewById(R.id.CodecRadioGroup);
    mRTCModeRadioGroup = (RadioGroup) findViewById(R.id.RTCModeGroup);

    mCheckBoxBeauty = (CheckBox) findViewById(R.id.CheckboxBeauty);
    mCheckBoxDebugMode = (CheckBox) findViewById(R.id.CheckboxDebugMode);
    mCheckBoxAudioLevel = (CheckBox) findViewById(R.id.CheckboxAudioLevel);
    mCheckboxEnableStats = (CheckBox) findViewById(R.id.CheckboxEnableStats);

    mRoomEditText = (EditText) findViewById(R.id.RoomNameEditView);
    SharedPreferences preferences = getSharedPreferences(getString(R.string.app_name), Context.MODE_PRIVATE);
    mRoomEditText.setText(preferences.getString("roomName", ""));

    MultiDex.install(this);
}
 
开发者ID:pili-engineering,项目名称:PLDroidRTCStreaming,代码行数:22,代码来源:ConferenceEntryActivity.java

示例5: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    MultiDex.install(this);

    Logger.addLogAdapter(new AndroidLogAdapter() {
        @Override
        public boolean isLoggable(int priority, String tag) {
            return BuildConfig.DEBUG;
        }
    });

    Hawk.init(getBaseContext()).build();

    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/lato_regular.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build()
    );
}
 
开发者ID:mayuroks,项目名称:Coin-Tracker,代码行数:22,代码来源:BaseApplication.java

示例6: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
    public void onCreate() {
        MultiDex.install(this);
        super.onCreate();
        instance = this;
        aCache = ACache.get(this);
        DemoHelper.getInstance().init(this);
        SDKInitializer.initialize(this);
        EMClient.getInstance().init(this, initChatOptions());
        EMClient.getInstance().setDebugMode(true);
        initRedPacket();
//        F.setLog(false);
//        //崩溃处理
        CrashHandlerUtil crashHandlerUtil = CrashHandlerUtil.getInstance();
        crashHandlerUtil.init(this);
        crashHandlerUtil.setCrashTip("很抱歉,程序出现异常,即将退出!");
        Config.DEBUG = true;
        initUM();
        QueuedWork.isUseThreadPool = false;
        UMShareAPI.get(this);
    }
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:22,代码来源:GApplication.java

示例7: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
    public void onCreate() {
        super.onCreate();

        MultiDex.install(getApplicationContext());

//        if (AppUtils.isNamedProcess(getApplicationContext(), getPackageName())) {
        //androidtools init
        AndroidTools.init(getApplicationContext(), BuildConfig.LOG_TAG);
        //UMeng init
        String umeng_appkey = AppUtils.getMetaDataString(getApplicationContext(), "UMENG_APPKEY");
        String umeng_channel = AppUtils.getMetaDataString(getApplicationContext(), "UMENG_CHANNEL");
        MobclickAgent.UMAnalyticsConfig config = new MobclickAgent.UMAnalyticsConfig(getApplicationContext(), umeng_appkey, umeng_channel);
        MobclickAgent.startWithConfigure(config);
        MobclickAgent.setDebugMode(BuildConfig.INNER_TEST);
        MobclickAgent.setCatchUncaughtExceptions(true);
        MobclickAgent.openActivityDurationTrack(false);
//        }
    }
 
开发者ID:Jusenr,项目名称:zxing_qrcode_demo,代码行数:20,代码来源:TotalApplication.java

示例8: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    appComponent = createAppComponent();
    MultiDex.install(this);
    init();
}
 
开发者ID:iamBedant,项目名称:InstantAppStarter,代码行数:8,代码来源:App.java

示例9: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    MultiDex.install(this);
    //init firebase
    FirebaseDatabase.getInstance().setPersistenceEnabled(true);

    Fresco.initialize(this, ImagePipelineConfigFactory.getImagePipelineConfig(this));
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:10,代码来源:HotelApp.java

示例10: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    mContext = getApplicationContext();

    MultiDex.install(getApplicationContext());

    baseComponent = DaggerBaseComponent.builder()
            .baseModule(new BaseModule())
            .build();

    BaseApi.init();

    //AndroidTools initialization
    AndroidTools.init(getApplicationContext(), getLogTag());

    //OkHttpClient initialization
    MyOkHttpClient.init(getApplicationContext());

    //Fresco initialization
    Fresco.initialize(getApplicationContext(),
            ImagePipelineFactory.imagePipelineConfig(getApplicationContext()
                    , MyOkHttpClient.provideOkHttpClient()
                    , getCacheDir().getAbsolutePath()));

    //UMeng initialization
    MobclickAgent.setDebugMode(BuildConfig.IS_TEST);
    MobclickAgent.setCatchUncaughtExceptions(true);
    MobclickAgent.openActivityDurationTrack(false);

    mActivityManager = new ActivityManager();
}
 
开发者ID:Jusenr,项目名称:RX_Demo,代码行数:33,代码来源:TotalApplication.java

示例11: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    context = this.getApplicationContext();
    Fresco.initialize(this);
    CookieJarImpl cookieJar1 = new CookieJarImpl(new MemoryCookieStore());
    OkHttpClient okHttpClient = new OkHttpClient.Builder()
            .connectTimeout(10000L, TimeUnit.MILLISECONDS)
            .readTimeout(10000L, TimeUnit.MILLISECONDS)
            .addInterceptor(new LoggerInterceptor("TAG"))
            .cookieJar(cookieJar1)
            .build();
    OkHttpUtils.initClient(okHttpClient);




    MultiDex.install(this);

    //开启debug模式,方便定位错误,具体错误检查方式可以查看http://dev.umeng.com/social/android/quick-integration的报错必看,正式发布,请关闭该模式
    //Config.DEBUG = true;

    initXY(context);
    //Thread.setDefaultUncaughtExceptionHandler(crashHandler);
    SharedPreferencesUtil.init(context,"deepSP",MODE_PRIVATE);
    /**
     * 初始化imageloader
     */
    ImageLoaderConfiguration configuration = ImageLoaderConfiguration.createDefault(this);
    ImageLoader.getInstance().init(configuration);
}
 
开发者ID:lwd1815,项目名称:Selector,代码行数:32,代码来源:MyApplication.java

示例12: attachBaseContext

import android.support.multidex.MultiDex; //导入依赖的package包/类
/**
 * tinker
 * @param base
 */
@Override
public void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    //you must install multiDex whatever tinker is installed!
    MultiDex.install(base);
}
 
开发者ID:ittianyu,项目名称:POCenter,代码行数:11,代码来源:BaseApplication.java

示例13: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MultiDex.install(this);
    progressBar = new ProgressDialog(this);
    progressBar.setIndeterminate(true);


}
 
开发者ID:jcolladosp,项目名称:PimPam,代码行数:10,代码来源:BaseActivity.java

示例14: onCreate

import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    // Setting the version name of the sdk, This data will be added 
    // to the user metadata and will help in future when doing code updating.
    BDefines.BAppVersion = BuildConfig.VERSION_NAME;
    
    MultiDex.install(this);




    // Logging tool.
    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    } else {
        Timber.plant(new Timber.HollowTree());
    }


    // Android chat SDK init!
    ChatSDKUiHelper.initDefault();
    BNetworkManager.init(getApplicationContext());
    // Adapter init.
    BChatcatNetworkAdapter adapter = new BChatcatNetworkAdapter(getApplicationContext());
    BNetworkManager.sharedManager().setNetworkAdapter(adapter);
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:29,代码来源:AppObj.java

示例15: install

import android.support.multidex.MultiDex; //导入依赖的package包/类
/**
 *  Installs secondary dexes if possible/necessary.
 *
 *  Isolated processes (e.g. renderer processes) can't load secondary dex files on
 *  K and below, so we don't even try in that case.
 *
 *  In release builds of app apks (as opposed to test apks), this is a no-op because:
 *    - multidex isn't necessary in release builds because we run proguard there and
 *      thus aren't threatening to hit the dex limit; and
 *    - calling MultiDex.install, even in the absence of secondary dexes, causes a
 *      significant regression in start-up time (crbug.com/525695).
 *
 *  @param context The application context.
 */
@VisibleForTesting
public static void install(Context context) {
    if (!BuildConfig.isMultidexEnabled()) return;

    // TODO(jbudorick): Back out this version check once support for K & below works.
    // http://crbug.com/512357
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
            && !shouldInstallMultiDex(context)) {
        Log.i(TAG, "Skipping multidex installation: not needed for process.");
    } else {
        MultiDex.install(context);
        Log.i(TAG, "Completed multidex installation.");
    }
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:29,代码来源:ChromiumMultiDexInstaller.java


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