本文整理匯總了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.");
}
}