vania-janet/multiturn-rag-retrieval-data huggingface dataset:
App Configuration client SDK for Android 

App Configuration service provides Android client SDK to integrate with your Android application that is written in Kotlin or Java programming language.



 Prerequisites 

Following are the prerequisites for using the App Configuration service SDK for Android:



* Android API level 22 or later
* [Android Studio](https://developer.android.com/studio/index.html)
* [Gradle](https://gradle.org/install)







 Integrating client SDK for Android app written in Kotlin 

App Configuration service provides Android client SDK to integrate with your Android application. You can evaluate the values of your property and feature flag by integrating the SDK.



1. Install the SDK by using either one of the options:



* [Download](https://github.com/IBM/appconfiguration-android-client-sdk) and import the package to your Android studio project.
* Get the package through Gradle by adding the:



* Add App Configuration Android client SDK dependency to Project level build.gradle file.

repositories {
mavenCentral()
}
* Add App Configuration Android client SDK dependency to Module level build.gradle file.

dependencies {
implementation "com.ibm.cloud:appconfiguration-android-sdk:0.3.1"
}





2. Configure the AndroidManifest.xml file for internet permission.

<uses-permission android:name="android.permission.INTERNET"/>
3. Initialize the SDK.

val appConfiguration = AppConfiguration.getInstance()

appConfiguration.init( application,
"region",
"guid",
"apikey")

//To start the configuration fetching operation, set the collectionId and environmentId in the following way.
appConfiguration.setContext("collectionId","environmentId")

Where:



* region - Region name where the service instance is created.
import com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush;

// with this

import com.ibm.cloud.eventnotifications.destination.android.ENPush;
3. Initialize the new SDK

// Replace the below section

BMSClient.getInstance().initialize(this, "ibmCloudRegionSuffix");
MFPPush push = MFPPush.getInstance();
push.initialize(getApplicationContext(), "appGUID", "clientSecret");

// with this

String instanceGUID = "<instance_guid>>";
String destinationID = "<instance_destination_id>";
String apiKey = "<instance_apikey>";

ENPush enPush = ENPush.getInstance();
push.setCloudRegion(ENPush.REGION_US_SOUTH); // Set your region

push.initialize(getApplicationContext(),instanceGUID,destinationID, apiKey);
Show more

There are additional fields like destinationID and apikey in the new initialize() method.

For more information, on getting the apikey for client SDK see [Managing service access](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-service-access-management).
4. The callback class in the new SDK has changes. Make these changes in the listener.

// Replace the below section

MFPPushNotificationListener notificationListener = new MFPPushNotificationListener() {

@Override
public void onReceive (final MFPSimplePushNotification message){
// Handle Push Notification
}
};

push.listen(notificationListener)

// with this

ENPushNotificationListener notificationListener = new ENPushNotificationListener() {

@Override
Modify your project in Firebase console 

The package name for the Push Notifications SDK was com.ibm.mobilefirstplatform.clientsdk.android.push. The new Event Notification SDK has the package com.ibm.cloud.eventnotifications.destination.android. Update your project in Firebase Console with the new package, then download and replace the new google-services.jsonfile in your Android project.



1. Go to the [Firebase Console](https://console.firebase.google.com)

Zoom

![Firebase console](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-migration-firebase-console.png)

Figure 3. Firebase Console
2. Select the project that you are using for Push Notifications.

Zoom

![Select project](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-migration-firebase-project.png)

Figure 4. Select project
3. In the navigation panel, select the Settings icon next to the Project Overview and select Settings > Project settings. Scroll down to locate Your apps.

Zoom

![Project setting](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-migration-firebase-setting.png)

Figure 5. Project setting
4. Find an app with package name com.ibm.mobilefirstplatform.clientsdk.android.push and click Remove this app.
5. Click Add app > Choose Android
6.
[Kubernetes secure app deployment strategies](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/sat_setup_ds-selection.png)

Figure 2. Deployment strategies
2. Click Continue.







 Configure the application source code repo 

In the Application step, the recommended options for the application source code repo are displayed by default. To view all of the available options for the underlying Git integration, click Advanced Options. By default, the toolchain uses the default sample that clones the sample app as an IBM-hosted Git Repos and Issue Tracking repo.

Zoom

![Kubernetes secure app repository](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/sat_kub_setup_app_repo.png)

Figure 3. Kubernetes secure app repository

You can change the name of the app repo. The region of the repo remains the same as the region of the toolchain.

The toolchain template provides a [Hello Containers Application](https://us-south.git.cloud.ibm.com/open-toolchain/hello-containers) app. If you want to link an existing Application repo for the toolchain, select Bring your own app and specify the URL for the repo. The toolchain supports linking only to existing Git Repos and Issue Tracking repos.

By default, the application repo template is cloned to your Git Repos and Issue Tracking org. To change the org, enable Advanced options and specify the repo owner.





 Configure the inventory repo 

The inventory repo records the details of the artifacts that are built by the continuous integration toolchains.
Important: Additional steps for performing a mirrored installation of new next-generation models
: Important: These steps are no longer needed if you install case package 4.0.6. For more information, see [28 January 2022 (Version 4.0.5)](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-release-notes-dataspeech-to-text-data-28january2022).

If you are performing a mirrored installation (for example, for an air-gapped environment) and plan to install any of the new next-generation models for Speech to Text (for more information, see the later release note), you must perform an additional step before completing either of the following steps:



* Step 7 [Mirroring the images to the private container registry](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=registry-mirroring-images-bastion-nodereference_g4h_z1q_tpb__mirror-to-target) of Mirroring images with a bastion model
* Step 8 [Mirroring the images to the intermediary container registry](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=registry-mirroring-images-intermediary-containerpreinstall_container_registry_air_gapped__mirror-to-target) of Mirroring images with an intermediary container registry



Each additional step is unique to the model that is being installed. If you install more than one of the new models, issue the indicated command for each model that you are installing.



* For the Chinese telephony model (zh-CN_Telephony):
App Configuration server SDK for Java 

App Configuration service provides SDKs to integrate with your applications, microservices, and distributed environments.



 Integrating server SDK for Java 

App Configuration service provides SDK to integrate with your Java applications. You can evaluate the values of your feature flag by integrating the App Configuration SDK.



1. Install the SDK in one of the following ways.

Using Maven

<dependency>
<groupId>com.ibm.cloud</groupId>
<artifactId>appconfiguration-java-sdk</artifactId>
<version>0.3.3</version>
</dependency>

Get the package through Gradle by adding:

implementation group: 'com.ibm.cloud', name: 'appconfiguration-java-sdk', version: '0.3.3'
2. In your Java microservice or application, include the SDK with:

import com.ibm.cloud.appconfiguration.sdk.AppConfiguration;
3. Initialize the SDK to connect with your App Configuration service instance.

String region = AppConfiguration.REGION_US_SOUTH;
String guid = "guid";
String apikey = "apikey";

String collectionId = "airlines-webapp";
String environmentId = "dev";

AppConfiguration appConfigClient = AppConfiguration.getInstance();
appConfigClient.init(region, guid, apikey);
appConfigClient.setContext(collectionId, environmentId);

Where,



* region: Region name where the service instance is created. Use AppConfiguration.REGION_US_SOUTH for Dallas, AppConfiguration.REGION_US_EAST for Washington DC, AppConfiguration.REGION_EU_GB for London, and AppConfiguration.REGION_AU_SYD for Sydney.
* guid: GUID of the App Configuration service. Get it from the service credentials section of the App Configuration service dashboard.
@Override
public void onReceive(final ENSimplePushNotification message) {
if (message.getActionName().equals("Accept Button")){
System.out.print("Clicked Accept Action");
} else if (message.getActionName().equals("Decline Button")){
System.out.print("Clicked Decline Action");
} else if (message.getActionName().equals("View Button")){
System.out.print("Clicked View Action");
}
}
};
Show more



Your Android mobile app is ready to work with your new instance of IBM Cloud® Event Notifications.







 Step 3: Modify an iOS mobile application 

Modify the mobile app source code to use the new Event Notifications SDKs. You will replace the existing Push Notifications service SDK with the Event Notifications FCM SDK.



 Create an iOS destination 

Create a destination of type Apple Push Notification (APNs) for the iOS app. Provide the P12 or P8 and their configurations.

Zoom

![Create iOS destination](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-migration-apns.png)

Figure 7. Create iOS destination





 Edit the iOS application 

Follow these steps to migrate from BMPush to ENPushDestination:



1. Change the import statement

// Replace this

import BMSCore
import BMSPush

// with this

import ENPushDestination
2. Replace SDK Initialization code

// Replace this

let push = BMSClient.sharedInstance

push.initialize(bluemixRegion: "<IBM cloud region>")

push.initializeWithAppGUID(
appGUID: "<IBM Cloud Push Instance GUID>",
Unsupported functionality includes:



* Multiple transition rules per bucket.
* Filtering objects to archive using a prefix or object key.
* Tiering between storage classes.



Classic Infrastructure (non-IAM) users are unable to set the transition storage class to ACCELERATED.





 Using the REST API and SDKs 



 Create a bucket lifecycle configuration 

This implementation of the PUT operation uses the lifecycle query parameter to set lifecycle settings for the bucket. This operation allows for a single lifecycle policy definition for a given bucket. The policy is defined as a rule consisting of the following parameters: ID, Status, and Transition.

The transition action enables future objects written to the bucket to an archived state after a defined period of time. Changes to the lifecycle policy for a bucket are only applied to new objects written to that bucket.

Cloud IAM users must have at a minimum the Writer role to add a lifecycle policy to the bucket.

Classic Infrastructure Users must have Owner Permissions and be able to create buckets in the storage account to add a lifecycle policy to the bucket.

This operation does not make use of additional operation specific query parameters.



 Header Type Description 

 Content-MD5 string Required: The base64 encoded 128-bit MD5 hash of the payload, used as an integrity check to ensure the payload was not altered in transit. 



The body of the request must contain an XML block with the following schema:



 Element Type Children Ancestor Constraint 

 LifecycleConfiguration Container Rule None Limit 1. 
 Rule Container ID, Status, Filter, Transition LifecycleConfiguration Limit 1. 
 ID String None Rule Must consist of (a-z,A-Z0-9) and the following symbols:!_.*'()- 
 Filter String Prefix Rule Must contain a Prefix element 
 Prefix String None Filter Must be set to <Prefix/>. 
 Transition Container Days, StorageClass Rule Limit 1 transition rule, and a maximum of 1000 total rules. 
 Days Non-negative integer None Transition Must be a value equal to or greater than 0. 
 Date Date None Transistion Must be in ISO 8601 Format and the date must be in the future. 
 StorageClass String None Transition GLACIER or ACCELERATED 



Syntax
* If the user is evaluated to be part of the segment and the segment percentage rollout is set to a percentage, say 50%, then the SDK checks if the user belongs to configured rollout size, if the user belongs to the rollout criteria, then the SDK returns the segment overriding value. If the user doesn't belongs to the rollout criteria, then the SDK returns Disabled value.







 View as table 



Table 1. Percentage rollout scenarios

 Feature Flag Is targeting configured? Percentage <br>rollout Is user <br>part of <br>configured segment Is user <br>part of <br>percentage rollout <br>criteria Value <br>returned <br>by SDK 

 Disabled NA Any % rollout set NA NA Disabled value 
 Enabled No 0% NA No Disabled value 
 Enabled Yes 0% Yes No Disabled value 
 Enabled Yes 0% No No Disabled value 
 Enabled No Between 0% to 100% NA Yes Enabled value 
 Enabled No Between 0% to 100% NA No Disabled value 
 Enabled Yes Betweeen 0% to 100% Yes Yes Overriden value 
 Enabled Yes Betweeen 0% to 100% Yes No Disabled value 
 Enabled Yes Between 0% to 100% No Yes Enabled value 
 Enabled Yes Between 0% to 100% No No Disabled value 
 Enabled No 100% NA Yes Enabled value 
 Enabled Yes 100% Yes Yes Overriden value 
 Enabled Yes 100% No Yes Enabled value 









 Targeting a segment with a feature flag 

You can roll out feature flags to one or more target segments. You can set different flag values for different segments, if needed.



1. From the App Configuration console, go to Feature flags. This pane displays the list of feature flags available in the current environment of the App Configuration service instance.
2. Click Add targeting in the required feature flag row to display the Target flag to segments side-panel.

Zoom

!
App Configuration JavaScript client SDK 

App Configuration service provides SDK to integrate with your browser applications.



 Integrating client SDK for JavaScript 

App Configuration JavaScript client SDK can be used with all the major browsers. You can evaluate the values of your feature flag and property by integrating the App Configuration SDK.



1. Install the SDK. Use the following code to install the SDK as a module from package manager.

npm install ibm-appconfiguration-js-client-sdk
2. You can import the SDK into the script tag either by referencing it from a hosted site on your backend or from a CDN as follows:

<script type="text/javascript" src="https://unpkg.com/ibm-appconfiguration-js-client-sdk@latest/dist/appconfiguration.js"></script>
3. Initialize the sdk to connect with your App Configuration service instance.

const region = AppConfiguration.REGION_US_SOUTH;
const guid = '<guid>';
const apikey = '<apikey>';
const collectionId = '<collectionId>';
const environmentId = '<environmentId>';

const client = AppConfiguration.getInstance();
client.init(region, guid, apikey);
await client.setContext(collectionId, environmentId);

The init() and setContext() are the initialisation methods and should be invoked only once using appConfigClient. The appConfigClient, once initialised, can be obtained across modules using AppConfiguration.getInstance().

Where:



* region: Region where the service instance is created. Use AppConfiguration.REGION_US_SOUTH for Dallas, AppConfiguration.REGION_US_EAST for Washington DC, AppConfiguration.REGION_EU_GB for London, and AppConfiguration.REGION_AU_SYD for Sydney.
Important: Extra steps for mirrored installation are no longer necessary
: Important: The [26 January 2022 release notes](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-release-notes-dataspeech-to-text-data-26january2022) included important notes for the following steps:



* Additional step for performing a mirrored installation of Minio datastore
* Additional steps for performing a mirrored installation of new next-generation models



These additional steps are no longer needed. The case package has been updated to correct the installation issues.





 26 January 2022 (Version 4.0.5) 

Version 4.0.5 is now available
: Speech to Text for IBM Cloud Pak for Data version 4.0.5 is now available. This version supports IBM Cloud Pak for Data version 4.x and Red Hat OpenShift versions 4.6 and 4.8. For more information about installing and managing the service, see [Installing Watson Speech to Text](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=text-installing-watson-speech).

Important: Additional step for performing a mirrored installation of Minio datastore
: Important: These steps are no longer needed if you install case package 4.0.6. For more information, see [28 January 2022 (Version 4.0.5)](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-release-notes-dataspeech-to-text-data-28january2022).

If you are performing a mirrored installation (for example, in an air-gapped environment), you need to perform an additional step before completing either of the following steps:



* Step 7 [Mirroring the images to the private registry](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=registry-mirroring-images-bastion-nodereference_g4h_z1q_tpb__mirror-to-target) of Mirroring images with a bastion model
: The service no longer returns HTTP status code 490 for the session-based HTTP methods GET /v1/sessions/{session_id}/observe_result and POST /v1/sessions/{session_id}/recognize. The service now responds with HTTP status code 400 instead.





 21 September 2015 

New mobile SDKs available
: Two new beta mobile SDKs are available for the speech services. The SDKs enable mobile applications to interact with both the Speech to Text and Text to Speech services.



* The Watson Speech SDK for the Google Android™ platform supports streaming audio to the Speech to Text service in real time and receiving a transcript of the audio as you speak. The project includes an example application that showcases interaction with both of the speech services. The SDK is available from the [speech-android-sdk repository](https://github.com/watson-developer-cloud/speech-android-sdk) in the watson-developer-cloud namespace on GitHub.
* The Watson Speech SDK for the Apple® iOS operating system supports streaming audio to the Speech to Text service and receiving a transcript of the audio in response. The SDK is available from the [speech-ios-sdk repository](https://github.com/watson-developer-cloud/speech-ios-sdk) in the watson-developer-cloud namespace on GitHub.



Both SDKs support authenticating with the speech services by using either your IBM Cloud service credentials or an authentication token. Because the SDKs are beta, they are subject to change in the future.

New Brazilian Portuguese and Mandarin Chinese models
: The service supports two new languages, Brazilian Portuguese and Mandarin Chinese, with the following models:



* Brazilian Portuguese broadband model (pt-BR_BroadbandModel)
* Brazilian Portuguese narrowband model (pt-BR_NarrowbandModel)
* Mandarin Chinese broadband model (zh-CN_BroadbandModel)
* Mandarin Chinese narrowband model (zh-CN_NarrowbandModel)



For more information, see [Previous-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models).
enPush.setCloudRegion(ENPush.REGION_US_SOUTH); // Set your region

enPush.initialize(getApplicationContext(),instanceGUID,destinationID, apiKey);
* When the SDK is initialized, [register](https://github.com/IBM/event-notifications-destination-android-sdkregister-for-notifications) for push notifications.

// Register the device to Event Notifications
enPush.registerDeviceWithUserId("userId",new ENPushResponseListener<String>() {

@Override
public void onSuccess(String deviceId) {
//handle successful device registration here
}

@Override
public void onFailure(ENPushException ex) {
//handle failure in device registration here
}
});
* Optionally if you can also create push tag subscription, [subscribeToPushTag](https://github.com/IBM/event-notifications-destination-android-sdksubscribe-to-tags) for push device. The subscribe API subscribes the device for a particular tag. After the device is subscribed to a particular tag, the device can receive notifications that are sent for that tag. Add the following code snippet to your Android mobile application to subscribe to a list of tags.

// Subscribe to the given tag, if tagname is not available it will first get create then push device will get subscribe to it.
enPush.subscribe(tagName, new ENPushResponseListener<String>() {

@Override
public void onSuccess(String arg) {
System.out.println("Succesfully Subscribed to: "+ arg);
}

@Override
public void onFailure(ENPushException ex) {
System.out.println("Error subscribing to Tag1.." + ex.getMessage());
}
For the sample app, update the welcome message:

a. On the Toolchain's Overview page, on the Repositories card, click the sample app repo.

b. Update the welcome message in the utils.js file.

c. Wait until the continuous integration pipeline run completes successfully.
4. Run the manual trigger from the continuous delivery pipeline and wait until the continuous delivery pipeline run completes successfully.
5. Check the app URL again to confirm that the updated app is deployed. Both of the app versions are running simultaneously. All of the network traffic is flowing to the updated app.
6. Test the rollback by running the switch-blue-green trigger from the continuous delivery pipeline. Wait until the switch trigger pipeline run completes successfully.

Zoom

![Successful continuous delivery pipeline switch trigger](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/ds-vpc-explore-switch-trigger-successful-bg.png)

Figure 17. Successful continuous delivery pipeline switch trigger
7. Check the app URL again to confirm that the previous version of the app is displayed.



You can run the switch trigger multiple times to alternate between the previous and latest versions of the app.









 Looking for help? 

Get help from the IBM Cloud® Continuous Delivery development teams by joining us on [Slack](https://ic-devops-slack-invite.us-south.devops.cloud.ibm.com/).

For more support options, see [Getting help and support for Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-gettinghelp).