當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。