Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count number of method in a Library (Jar/AAR)

How do we count the number of methods in a Library file.

For eg, a Jar or AAR.

This is required to know the number of android resource IDs used by the library used by the project. This would help in estimating how close we are to 65K dex limit in Android.

like image 641
B.B. Avatar asked Feb 17 '16 11:02

B.B.


2 Answers

  • dexcount-gradle-plugin: gradle plugin, works for any Android project (library or application), nice D3 sunburst partition chart output.
  • dex-method-counts: command-line tool, supports apk / zip / dex / directory.
  • Methods Count: only works for online public library, just give library 'compile' statement (e.g., com.google.code.gson:gson:2.4).
  • APK method count: only works for APK, expandable tree results.
like image 155
Jing Li Avatar answered Nov 14 '22 23:11

Jing Li


Why don't you give this site a try, MethodsCount. It also gives you with an awesome Android Studio plugin which add method count beside all your libraries in the build.gradle file.

You can also try this and this. I have tried both of them and they are worth checking.

like image 29
Aritra Roy Avatar answered Nov 14 '22 23:11

Aritra Roy