"Android Development Art Quest" Reading notes (12)--bitmap Loading and caching
NO1:
Use Crashhandler to get crash information for your app
No2:
The maximum number of methods that a single Dex file can contain in Android is 65536, which contains all the methods in the Android FrameWork, the dependent jar packages, and the code in the app itself.
No3:
Using Multidex To resolve the number of methods out of bounds
Apply plugin: ' Com.android.application ' android {compilesdkversion buildtoolsversion ' 22.0.1 ' defaultconfig { ApplicationID "Com.ryg.multidextest" Minsdkversion 8 targetsdkversion Versioncode 1 Versionname "1.0"//Enable MULTIDEX supportmultidexenabled True} buildtypes {release {minifyenabled false proguardfiles getdefaultproguardfile (' Proguar D-android.txt '), ' Proguard-rules.pro '}}afterevaluate {println "afterevaluate" tasks.matching {it.name.startsWith (' dex ')}.each {dx- def listfile = Project.rootDir.absolutePath + '/app/maindexlist.txt ' println "root dir:" + Project.rootDir.ab Solutepath println "Dex task found:" + dx.name if (dx.additionalparameters = = null) {Dx.additio Nalparameters = []} dx.additionalparameters + = '--multi-dex ' dx.additionalparameters + = '--main-dex- List= ' + listfile dx.additionalparameters + = '--minimal-main-dex '}}dependencies {Compile filetree (dir: ' Libs ', include: [' *.jar ']) compile ' com.android.support:appcompat-v7:22.1.1 'compile ' com.android.support:multidex:1.0.0 '}
The afterevaluate zone is to specify which classes are included in the Dex file, and the class name is written in Maindexlist.txt
Note: The 9 classes in the Multidex jar package must also be packaged in the main Dex
Code support
Public class extends Application { @Override protectedvoid attachbasecontext (Context base) { Super . Attachbasecontext (base); Multidex.install (this);} }
Although the Multidex method solves the problem of crossing the number of methods well, it also causes the application to start slower because additional dex files are loaded when the app starts.
No4:
Android Dynamic loading technology (plug-in technology)
NO5:
Anti-compilation
"Android Development Art Quest" Reading notes (13)--Integrated technology