Wed, 06/28/2017 - 08:39
#1
Very large APK after adding MapQuest SDK
I've started using the MapQuest SDK in my Android project, and noticed that my APK file becomes 16 MB. Before importing the SDK, my APK was less than 2 MB.
Are there other users who have seen a dramatic increase to their APK?
What are some suggestions to keeping the APK file size small?
Thank you for the link. It's insightful and provides good direction.
I'm working on the ProGuard rules to exclude specified classes. My project only requires the display of markers, polylines, polygons, and user location -- basic functionality. I don't need traffic, directions, and geocoding in this project. Can you tell me what non-MapQuest and non-MapBox classes can be excluded? I assume there are more to be excluded than what I have specified already. Here's my "proguard-rules.pro" file. My project compiled successfully.
# Exclude mapping classes not used in the project
# Traffic, Directions, Geocoding, MapMatching, and StaticImage
-keep class !com.mapquest.mapping.BuildConfig, com.mapquest.android.traffic.** { *; }
-keep class !com.mapbox.mapboxsdk.BuildConfig, com.mapbox.services.directions.** { *; }
-keep class !com.mapbox.mapboxsdk.BuildConfig, com.mapbox.services.geocoding.** { *; }
-keep class !com.mapbox.mapboxsdk.BuildConfig, com.mapbox.services.mapmatching.** { *; }
-keep class !com.mapbox.mapboxsdk.BuildConfig, com.mapbox.services.staticimage.** { *; }
# Other rules
-keepattributes InnerClasses
-keepattributes *Annotation*
#Suppress warnings
-dontwarn android.support.**
-dontwarn com.google.**
-dontwarn java.lang.**
-dontwarn java.nio.**
-dontwarn javax.annotation.**
-dontwarn sun.misc.**
-dontwarn org.codehaus.**
-dontwarn org.hamcrest.integration.**
-dontwarn org.hamcrest.beans.**
-dontwarn org.hamcrest.JMock1Matchers
-dontwarn org.apache.commons.math3.geometry.euclidean.twod.**