5

I have used Premium Android SDK of HERE Maps API and implemented demo app. But my application size is 65 MB.

Also I have enabled shrinkResources in app build.gradle file as follows, but this didn't work for me.

 android {
    // Other settings

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

So, my question is how can we reduce APK size used in Android SDK on HERE Maps API.

Bruno Parmentier
  • 1,219
  • 2
  • 14
  • 34
Nitin Karande
  • 1,280
  • 14
  • 33
  • Share your gradle dependency – Ravindra Kushwaha Aug 21 '18 at 11:49
  • This is an aar file , this provided by Here Maps Premium SDK. **implementation(name: 'HERE-sdk', ext: 'aar')** – Nitin Karande Aug 21 '18 at 11:51
  • 1
    Use the APK Analyzer in Android Studio to see where your space is going. – CommonsWare Aug 21 '18 at 11:53
  • @CommonsWare Here-sdk aar size is 62MB. all space gone by in libs folder – Nitin Karande Aug 21 '18 at 11:55
  • 5
    If `libs` contains several CPU architectures, you might consider using [APK splits](https://developer.android.com/studio/build/configure-apk-splits) to have different APKs per CPU architecture. – CommonsWare Aug 21 '18 at 12:14
  • @CommonsWare I have used splits { abi { include 'armeabi', 'mips', 'mips64' } } but facing same issue – Nitin Karande Aug 22 '18 at 05:46
  • 1
    There are some fonts you can try deleting (https://developer.here.com/documentation/android-premium/dev_guide/topics/size-management.html) however the Premium sdk is about 50-60 Mb in the end and you might not be able to bring it down further. If a light weight aplpication is required you might consider using the Starter SDK (with limited features ofcourse) – Jithin Krishnan Aug 22 '18 at 07:03

1 Answers1

1

Summary: There are some fonts you can try deleting (developer.here.com/documentation/android-premium/dev_guide/…) however the Premium SDK is about 50-60 Mb in the end and you might not be able to bring it down further. If a light weight application is required you might consider using the HERE SDK Lite (with limited features of course)

  • How to remove that fonts from the integration? – softwaresupply Dec 15 '20 at 12:08
  • @softwaresupply App level gradle > android{ packagingOptions { exclude '/lib/armeabi-v7a/libNanumGothicFontPkg.so' exclude '/lib/armeabi-v7a/libLohitIndicFontPkg.so' exclude '/lib/armeabi-v7a/libChineseFontPkg.so' }} – RaRa Feb 19 '21 at 09:40