Class Bots


  • public final class Bots
    extends java.lang.Object
    The SDK entry point from which various services can be accessed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String Version  
    • Constructor Summary

      Constructors 
      Constructor Description
      Bots()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void cancelTTS()
      Stops reading the skill's response aloud.
      static boolean clearConversationHistory()
      Clears the conversation history.
      static void clearConversationHistory​(ClearConversationCallback clearConversationCallback)
      Clears the conversation history.
      static boolean clearUnreadCount()
      Resets the count of the unread messages to 0
      static void connect()
      Reconnects the SDK with previous BotsConfiguration.
      static void connect​(BotsConfiguration botsConfiguration)
      Reconnects the SDK with new BotsConfiguration
      static void destroy()
      Terminates all the SDK facilities.
      static void disconnect()
      Disconnect the SDK
      static void endChat()
      Ends the current session of user.
      static AgentDetails getAgentDetails()
      Returns the current agent details for a particular agent session.
      static java.util.List<Message> getAllConversations()
      Returns the list of the conversation messages.
      static BotsConfiguration getBotsConfiguration()
      Returns the configuration object that's used to initialize the SDK with enabled features.
      static ConnectionStatus getConnectionStatus()
      Returns the current status of the WebSocket's connection to the skill.
      static oracle.cloud.bots.mobile.core.internals.MultiLangChatConfiguration getMultiLangChatConfiguration()  
      static int getReconnectAttemptsExhausted()
      Returns the number of attempts exhausted for establishing connection.
      static oracle.cloud.bots.mobile.core.SpeechSynthesisSetting getTTSVoice()
      Returns the voice that is used for speaking the utterances.
      static java.util.ArrayList<oracle.cloud.bots.mobile.core.SpeechSynthesisSetting> getTTSVoices()
      Returns list of all voices present in speech engine used to initialise Speech Synthesis Service object.
      static int getUnreadCount()
      Returns the count of unread messages.
      static void init​(android.app.Application application, java.lang.String url, java.lang.String channelId, java.lang.String userId, BotsCallback botsCallback)
      Initializes the SDK with the default configuration.
      static void init​(android.app.Application application, java.lang.String url, AuthenticationTokenProvider authTokenProvider, BotsCallback botsCallback)
      Initializes the SDK with the default configuration.
      static void init​(android.app.Application application, BotsConfiguration botsConfiguration)
      Initializes the SDK with the provided configuration.
      static void init​(android.app.Application application, BotsConfiguration botsConfiguration, BotsCallback botsCallback)
      Initializes the SDK with the provided configuration.
      static void initSpeechSynthesisService()
      Initializes the speech synthesis service.
      static boolean isInitialized()
      Checks if the SDK has been initialized or not.
      static boolean isRecording()
      Checks if the voice recording has started or not.
      static boolean isSpeaking()
      Deprecated.
      As of release 21.08, replaced by isTTSSpeaking()
      static boolean isTTSSpeaking()
      Checks if the skill's response is currently being read aloud or not.
      static void sendAttachment​(FileWrapper attachment)
      Sends the uploaded attachment to the skill.
      static void sendLocation​(Geolocation geoLocation)
      Sends the location coordinates to the skill.
      static void sendMessage​(java.lang.String text)
      Sends a text message to the skill.
      static void sendMessage​(java.lang.String text, org.json.JSONObject metadata)
      Sends the text message and the metadata to the skill.
      static void sendMessage​(MessagePayload messagePayload)
      Sends a message to the skill.
      static void sendPostBack​(PostBackAction postBack)
      Sends the postback message to the skill.
      static void sendUserTypingStatus​(TypingStatus status, java.lang.String text)  
      static void setAgentDetails​(AgentDetails agentDetails)
      Sets the agent details dynamically.
      static void setEventListener​(EventListener eventListener)
      Sets the listener to receive the response returned from the skill, message sent to the skill, to get updates on connection status change, and to receive an update when attachment upload is complete.
      static void setPrimaryChatLanguage​(java.lang.String languageTag)
      Sets the language tag to be used for conversation.
      static void setShareMenuItemsUpdateListener​(ShareMenuItemsUpdateListener shareMenuItemsUpdateListenerLocal)  
      static void setSpeechLocale​(java.lang.String locale)
      Sets the locale used for speech connection.
      static oracle.cloud.bots.mobile.core.SpeechSynthesisSetting setSpeechSynthesisVoicePreferences​(java.util.ArrayList<oracle.cloud.bots.mobile.core.SpeechSynthesisSetting> speechSynthesisVoicePreferences)
      Deprecated.
      As of release 21.08, replaced by setTTSVoice(ArrayList)} and getTTSVoice()
      static void setTTSService​(SpeechSynthesisService ttsService)  
      static void setTTSVoice​(java.util.ArrayList<oracle.cloud.bots.mobile.core.SpeechSynthesisSetting> TTSVoices)
      Sets the voice preferences array which is used to choose the best match available voice for speech synthesis.
      static void setUIEventListener​(EventListener eventListener)
      Sets the listener for SDK UI to receive the response returned from the skill, message sent to the skill, to get updates on connection status change, and to receive an update when attachment upload is complete.
      static java.util.ArrayList<java.lang.Object> shareMenuItems()
      The object of ShareMenuItems.
      static void shareMenuItems​(java.util.ArrayList<java.lang.Object> shareMenuItems)
      Updates the share menu item list.
      static void shutdownBotAudioResponse()
      Releases the resources used by the SDK.
      static void speakTTS​(java.lang.String text)
      Starts reading the skill's response aloud.
      static void speakTTS​(Message message)
      Starts reading the skill's response aloud.
      static void startAudioRecorder​(IBotsSpeechListener iBotsSpeechListener)
      Starts only the audio recorder without performing speech recognition.
      static void startBluetoothSco()  
      static void startBotAudioResponse​(java.lang.String text)
      Deprecated.
      As of release 21.08, replaced by speakTTS(String) ()}
      static void startBotAudioResponse​(Message message)
      Deprecated.
      As of release 21.08, replaced by speakTTS(Message)
      static void startRecording​(IBotsSpeechListener listener)
      Starts recording the user's voice message.
      static void startSpeechRecognition​(IBotsSpeechListener iBotsSpeechListener, boolean startAudioRecorderIfTurnedOff, int noSpeechTimeout, int maxSpeechTimeout)
      Starts speech recognition if the audio recorder is already turned on, else provide a feature to turn on audio recorder and perform speech recognition.
      static void stopBluetoothSco()  
      static void stopBotAudioResponse()
      Deprecated.
      As of release 21.08, replaced by cancelTTS()
      static void stopRecording​(boolean forceClose)
      Stops recording the user's voice message.
      static void stopSpeechRecognition​(boolean forceClose)
      Stops an ongoing speech recognition without changing the state of audio recorder
      static void updateMessage​(Message message)
      Updates the respective message in the database based on stored id.
      static void updateUser​(User profile)
      Updates the user profile information.
      static void updateUser​(org.json.JSONObject profile)
      Updates the user profile information using the parameter passed in the form of JSONObject.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait