Migration¶
There are changes to various SDK libraries as well as migration requirements to consider when you move from one version of SAP BTP SDK for Android to the next.
Foundation¶
Add new API SDKInitializer.start(Application, MobileService ..., APIKey)
to initialize the SDK features, allowing apps
to interact with mobile services using API key before authentication is performed.
This API is intended to replace the existing MobileServices.start
method, and can be called at the beginning of
app initialization, as in Application.onCreate
method.
There is no need to wait for OkHttpClient
and SettingsParameters
to be ready, which is required in MobileServices.start
.
Migration in Release 3.0¶
Several methods have been marked as deprecated and will be removed in a future release:
Logging.uploadLog(OkHttpClient, SettingsParameters)
andLogging.uploadLog(OkHttpClient, SettingsParameters, UploadType)
are replaced byLogging.upload(OkHttpClient, SettingsParameters)
andLogging.upload(OkHttpClient, SettingsParameters, UploadType)
.Logging.addLogUploadListener(UploadListener)
andLogging.removeLogUploadListener(UploadListener)
are replaced byLogging.addUploadListener(UploadListener)
andLogging.removeUploadListener(UploadListener)
.AppUsageUploader.setListener(UploadListener)
is replaced byAppUsageUploader.addUploadListener(UploadListener)
to register a usage listener andAppUsageUploader.removeUploadListener(UploadListener)
to unregister a usage listener.UsageBroker.upload(boolean, Context, AppUsageUploader.UploadListener, SettingsParameters)
is replaced by callingAppUsageUploader.addUploadListener(AppUsageUploader.UploadListener)
first, then callingUsageBroker.upload(Context, SettingsParameters, boolean)
.UsageBroker.upload(boolean, Context, AppUsageUploader.UploadListener, SettingsParameters, boolean)
is replaced by callingAppUsageUploader.addUploadListener(AppUsageUploader.UploadListener)
first, then callingUsageBroker.upload(Context, SettingsParameters, boolean, boolean)
.UsageBroker.upload(boolean, AppUsageUploader.UploadListener, boolean, Context)
is replaced by callingAppUsageUploader.addUploadListener(AppUsageUploader.UploadListener)
first, then callingUsageBroker.upload(boolean, boolean, Context)
.UsageBroker.upload(Context, boolean, AppUsageUploader.UploadListener)
is replaced by callingAppUsageUploader.addUploadListener(AppUsageUploader.UploadListener)
first, then callingUsageBroker.upload(Context, boolean)
.
Add new API MobileServices.start(Application, OkHttpClient, SettingsParameters, Class<? extends MobileService>)
to
initialize the SDK features. To use this API, client code needs following changes:
- Remove the code
Logging.initialize(Context)
orLogging.initialize(Context, ConfigurationBuilder)
. This logic is included in the new API. UsageBroker.start
has an internal change in 3.0.0, now it should be called only aftersettingsParameter
set intoSettingsProvider
, otherwiseIllegalStateException
will be encountered. OrMobileServices.start
can be used to initialize usage.