This optimization guide lists several options to shrink the size of the HERE SDK and to optimize the runtime behavior by reducing the data that needs to loaded or processed.
With feature configurations you can specify how much map data should be loaded when panning the
MapView or when downloading a new
Region for offline usage. For example, if a feature like turn-by-turn navigation is never used in an application, it can be removed.
As a result, when panning the
MapView less data will be downloaded into the cache. In addition, when downloading a new
Region, its size will be smaller.
By default, all features are enabled. However, if a "FeatureConfiguration" is present in the
PList file, then only the listed features will be enabled, all others will be disabled. If you want to disable only one feature, then all other features need to be present, or they will be also disabled.
For example, the following enables only navigation and truck features and disables all others. On Android devices modify the
AndroidManifest file like so:
<meta-data android:name="com.here.sdk.feature_configuration" android:value="NAVIGATION, TRUCK" />
On iOS devices modify the
Plist file like so:
<key>FeatureConfiguration</key> <array> <string>NAVIGATION</string> <string>TRUCK</string> </array>
As of now, these features can be specified:
OfflineSearchEnginemay not work properly when being used offline.
OfflineRoutingEnginemay not work properly when being used offline.
OfflineRoutingEnginemay not work properly when being used offline to calculate truck routes. It is also used for map matching during truck navigation. When not set, truck navigation may not work properly when being used offline.
By removing unused fonts you can reduce the size of the HERE SDK. This is explained here.
By removing unused voice guidance files you can reduce the size of the HERE SDK.
These files are only needed when you want to use turn-by-turn navigation with text-to-speech voice messages.
Do the following to remove the unused files:
Here you can find a list of all supported voice languages together with the name of the related voice skin that is stored inside the HERE SDK framework.
Other options to optimize the HERE SDK include:
In addition, all engines contain several options that allow how to configure a feature. For example, when using the
SearchEngine, you can specify
SearchOptions to limit the returned search results.