Very large APK after adding MapQuest SDK

4 posts / 0 new
Last post
oasisinfosys
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?

 


MQBrianCoakley
There are methods described
There are methods described here that will help reduce the size of the apk, but you should still expect a pretty large increase in the apk size compared to the 2 mb it was at.

oasisinfosys
Unused classes to exclude

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.**

 


MQBrianCoakley
I haven't found it yet, but
I haven't found it yet, but one of the developers believes there is an option in proguard to automatically exclude all classes that aren't being used.