Migration in 3.0

There are changes to various SDK libraries as well as migration requirements to consider when you move from one version of SAP Cloud Platform SDK for Android to the next.

Foundation

Several methods have been marked as deprecated and will be removed in a future release:

  • Logging.uploadLog(OkHttpClient, SettingsParameters) and Logging.uploadLog(OkHttpClient, SettingsParameters, UploadType) are replaced by Logging.upload(OkHttpClient, SettingsParameters) and Logging.upload(OkHttpClient, SettingsParameters, UploadType).
  • Logging.addLogUploadListener(UploadListener) and Logging.removeLogUploadListener(UploadListener) are replaced by Logging.addUploadListener(UploadListener) and Logging.removeUploadListener(UploadListener).
  • AppUsageUploader.setListener(UploadListener) is replaced by AppUsageUploader.addUploadListener(UploadListener) to register a usage listener and AppUsageUploader.removeUploadListener(UploadListener) to unregister a usage listener.
  • UsageBroker.upload(boolean, Context, AppUsageUploader.UploadListener, SettingsParameters) is replaced by calling AppUsageUploader.addUploadListener(AppUsageUploader.UploadListener) first, then calling UsageBroker.upload(Context, SettingsParameters, boolean).
  • UsageBroker.upload(boolean, Context, AppUsageUploader.UploadListener, SettingsParameters, boolean) is replaced by calling AppUsageUploader.addUploadListener(AppUsageUploader.UploadListener) first, then calling UsageBroker.upload(Context, SettingsParameters, boolean, boolean).
  • UsageBroker.upload(boolean, AppUsageUploader.UploadListener, boolean, Context) is replaced by calling AppUsageUploader.addUploadListener(AppUsageUploader.UploadListener) first, then calling UsageBroker.upload(boolean, boolean, Context).
  • UsageBroker.upload(Context, boolean, AppUsageUploader.UploadListener) is replaced by calling AppUsageUploader.addUploadListener(AppUsageUploader.UploadListener) first, then calling UsageBroker.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) or Logging.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 after settingsParameter set into SettingsProvider, otherwise IllegalStateException will be encountered. Or MobileServices.start can be used to initialize usage.

See Foundation API Reference for further details.