本文整理汇总了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());
}
示例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());
}
示例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);
}
示例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);
}
示例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()
);
}
示例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);
}
示例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);
// }
}
示例8: onCreate
import android.support.multidex.MultiDex; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
appComponent = createAppComponent();
MultiDex.install(this);
init();
}
示例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));
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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.");
}
}