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.
Migration in Release 24.8.1¶
SAP BTP SDK for Android 24.8.1 Update¶
- From this version, the database library will be loaded in
SDKProcessObserverInitializer. If your app has a startup initializer that opens secure databases, please ensure that it runs afterSDKProcessObserverInitializer. For example:
class MyStartupInitializer : Initializer<Unit> {
override fun create(context: Context) {
...
}
override fun dependencies(): MutableList<Class<out Initializer<*>>> = mutableListOf(
SDKProcessObserverInitializer::class.java
)
}
Migration in Release 24.4.10¶
SAP BTP SDK for Android 24.4.10 Update¶
- From this version, the database library will be loaded in
SDKProcessObserverInitializer. If your app also has a startup initializer which will open secure databases, please make sure the initializer run afterSDKProcessObserverInitializer, for example:
class MyStartupInitializer : Initializer<Unit> {
override fun create(context: Context) {
...
}
override fun dependencies(): MutableList<Class<out Initializer<*>>> = mutableListOf(
SDKProcessObserverInitializer::class.java
)
}
Migration in Release 24.4.0¶
SAP BTP SDK for Android 24.4.0 Update¶
- When migrating from Jetpack compose Flows component version 7.x to 24.4.0, two flow option properties,
requireQRCodeConfirmScreenandqrCodeSecureOption, are deprecated and MUST be replaced with the corresponding properties inqrScanOption.
Migration in Release 5.1¶
SAP BTP SDK for Android 5.1.0 Update¶
To build projects successfully, you will need to:
- Upgrade the Android gradle plugin from 4.0.0 to 7.x in the project's
build.gradle. - Upgrade gradle from 6.1.1 to corresponding version in
gradlew-wrapper.propertiesreferring to Android Gradle plugin release notes. - Remove
android.jetifier.blacklistingradle.properties.
Migration in Release 5.0¶
SAP BTP SDK for Android 5.0.0 Update¶
To be able to make projects build successfully:
- Applications must specify version 11 for
Gradle JDK. - Set
compileSdkVersionin the android block to 31 inbuild.gradleat the module level. - If the Android Gradle plugin of your project is lower than version 7.0.2, refer to Troubleshooting.
Foundation Library 5.0.0 Update¶
- The
NotificationChannelConfigclass now supports an additional Boolean parameter in its constructor:NotificationChannelConfig(String, String, String, Int, Boolean, Int, Boolean, LongArray, Boolean). - Fixed an error in interface
PushCallbackListener: renamed functiononRecievetoonReceive. Any class implementingPushCallbackListenershould change the overriddenonRecievefunction name toonReceive. PushServiceis deprecated and removed.PushService.setPushMessageStatusis replaced byBasePushService.setPushMessageStatusandPushService.NotificationStatusis replaced byPushRemoteMessage.NotificationStatus.setRootLogLevel(LogPolicy)in classLogPolicyhas been marked as deprecated and will be removed in a future release.- When creating an instance of
AppConfigwith the builder API, besides theappIDproperty,hostorserviceUrlalso needs to be provided.
Migration in Release 4.0¶
Fiori Library 4.0.0 Update¶
- To be able to use the new SAP Fiori with Horizon Theme, apps must specify
Theme.Fiori.Horizon(or an extension of that theme) for their application theme, rather thanFioriTheme. - Any direct uses of
androidx.appcompat.widget.AppCompatButtonin XML layout files should be changed instead toButtonif using Button styles from either the SAP Fiori with Horizon Theme or the existingFioriTheme. - The data type of the
plotDataSetparameter passed intoChartHeaderView.setChartPlotData()has been changed fromMap<String, float[]>toMap<String, Object>to support the new Scatter Chart data type. com.sap.cloud.mobile.onboardinghas been deprecated in favor ofcom.sap.cloud.mobile.fiori.onboardingand will be removed in a future release.
Foundation Library 4.0.0 Update¶
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¶
Foundation Library 3.0.0 Update¶
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.starthas an internal change in 3.0.0, now it should be called only aftersettingsParameterset intoSettingsProvider, otherwiseIllegalStateExceptionwill be encountered. OrMobileServices.startcan be used to initialize usage.