Class MapKitFactory

com.yandex.mapkit

public class MapKitFactory

The MapKit factory.

Methods

native MapKit getInstance()

Gets the MapKit factory instance.

synchronized void initialize(Context context)

Initializes the MapKit factory.

synchronized void initializeBackgroundDownload(final Context context, @Nullable DownloadNotificationsListener listener)

This method checks if background downloading is needed.

synchronized void setApiKey(@NonNull String apiKey)

Sets the API key for MapKit SDK.

synchronized void setLocale(@Nullable String locale)

Sets locale for MapKit SDK. Useless if initialization has already finished.

Method Detail

getInstance

public static native MapKit getInstance ()

Gets the MapKit factory instance.

initialize

public static synchronized void initialize (Context context)

Initializes the MapKit factory.

initializeBackgroundDownload

public static synchronized void initializeBackgroundDownload (final Context context, @Nullable DownloadNotificationsListener listener)

This method checks if background downloading is needed.

If it is, the method initializes mapkit and starts downloading. Else nothing happens. This method is lightweight, please invoke it from Application.onCreate.
Parameters:
listener

will be notified when downloads have started. Warning: after MapKit initialization this method becomes useless.

setApiKey

public static synchronized void setApiKey (@NonNull String apiKey)

Sets the API key for MapKit SDK.

Useless if initialization has already finished. If API key isn't set before initialization, assert will fail

setLocale

public static synchronized void setLocale (@Nullable String locale)

Sets locale for MapKit SDK. Useless if initialization has already finished.