"Android Development Art Quest" Reading notes (13)--Integrated technology

Source: Internet
Author: User

"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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.