简体   繁体   中英

Android Studio - How does a library project used in an app follow with the app-release.apk

I'm using a library ( https://github.com/PhilJay/MPAndroidChart ) for plotting data in an android app. When app-release.apk is created by the program it is ready to be installed on the tablet I use for testing.

What is puzzling to me is how the parts of the library, which i use, follow with the release. In other scenarios, for example in Visual Studio and c# - program being installed on Window machine, libraries require dll files to be installed and registered on each targeted machine. In my scenario the library is written specifically for Android, but if I somehow managed to include a c++ or ac# library in my Android app using tools like libstdc++ or MONO, would it work the same way when it comes down to app-realease.apk?

Are all classes in a library included in the app-release.apk or just the parts that I use?

Thanks in advance and please let me know if the question is unclear before downvoting it!

Normally, when you build your APK, all the libs you have imported (jars) are included and transformed to dex files, as the rest of your code. So, yes all the classes are included, even if you don't use them. You can use Proguard to remove them from the APK. Look at this post : Use Proguard for stripping unused Support lib classes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM