All Projects → brijrajsingh → DirectLineAndroidSample

brijrajsingh / DirectLineAndroidSample

Licence: MIT license
Android Sample for Direct Line API - Microsoft Bot Framework

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to DirectLineAndroidSample

Botpress
🤖 Dev tools to reliably understand text and automate conversations. Built-in NLU. Connect & deploy on any messaging channel (Slack, MS Teams, website, Telegram, etc).
Stars: ✭ 9,486 (+45071.43%)
Mutual labels:  microsoft-bot-framework, conversation
apsconnect-cli
Warning: EOL for January 2021. CloudBlue Connect CLI tool to automate APS Package management in the CloudBlue Commerce instance (hub).
Stars: ✭ 13 (-38.1%)
Mutual labels:  connector
Soicbite
A compact PCB footprint which allows SOIC test clips to be used as a space-efficient programming and debugging connector
Stars: ✭ 161 (+666.67%)
Mutual labels:  connector
SupermarktConnector
Collecting product information from Dutch supermarkets: Albert Heijn and Jumbo using the Mobile API
Stars: ✭ 91 (+333.33%)
Mutual labels:  connector
Blocks.js
JavaScript dataflow graph editor
Stars: ✭ 165 (+685.71%)
Mutual labels:  connector
spark-connector
A connector for Apache Spark to access Exasol
Stars: ✭ 13 (-38.1%)
Mutual labels:  connector
Kafka Connect Mongodb
**Unofficial / Community** Kafka Connect MongoDB Sink Connector - Find the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector
Stars: ✭ 137 (+552.38%)
Mutual labels:  connector
CodeConversations
Code Conversations was a Demo is Scott Hanselman's keynote at Microsoft BUILD 2020. Code Conversations was designed with one goal in mind - to see if we could bring the power of .NET Interactive into Microsoft Teams, to create a way for people to have collaborative conversations about small bits of code.
Stars: ✭ 109 (+419.05%)
Mutual labels:  microsoft-bot-framework
OpenSCAD connectors
Simple, parametric APIs for connectors such as corner brackets and t-joints. Specializing on connectors for aluminum extrusion connectors.
Stars: ✭ 29 (+38.1%)
Mutual labels:  connector
keda-connectors
Generic connectors for Keda which can be used as worker images as part of scaleTargetRef.
Stars: ✭ 22 (+4.76%)
Mutual labels:  connector
Powerplatformconnectors
This is a repository for Microsoft Power Automate, Power Apps, and Azure Logic Apps connectors
Stars: ✭ 209 (+895.24%)
Mutual labels:  connector
Go Clickhouse
Golang ClickHouse connector
Stars: ✭ 174 (+728.57%)
Mutual labels:  connector
wolf-core
🐺 Declarative development for state driven dynamic prompt flow
Stars: ✭ 26 (+23.81%)
Mutual labels:  conversation
Azure Cosmosdb Spark
Apache Spark Connector for Azure Cosmos DB
Stars: ✭ 165 (+685.71%)
Mutual labels:  connector
hyper-proxy
A proxy connector for Hyper-based crates
Stars: ✭ 73 (+247.62%)
Mutual labels:  connector
Azure Event Hubs Spark
Enabling Continuous Data Processing with Apache Spark and Azure Event Hubs
Stars: ✭ 140 (+566.67%)
Mutual labels:  connector
Grial
A Node.js framework for creating GraphQL API servers easily and without a lot of boilerplate.
Stars: ✭ 194 (+823.81%)
Mutual labels:  connector
Dialogue-Corpus
No description or website provided.
Stars: ✭ 27 (+28.57%)
Mutual labels:  conversation
msbotbuilder-go
Microsoft Bot Framework SDK for Go
Stars: ✭ 113 (+438.1%)
Mutual labels:  microsoft-bot-framework
chameleon-sdk
Chameleon Software Development Kit
Stars: ✭ 12 (-42.86%)
Mutual labels:  connector

DirectLineAndroidSample

Android Sample for Direct Line API - Microsoft Bot Framework

This android sample showcases the REST API usage of Direct Line API endpoints provided by the Microsoft Bot framework https://docs.botframework.com/en-us/restapi/directline3/

There are 4 steps in a chat conversations.

  1. Authentication - you get a primary token from the dev.botframework.com. to get the token go to dev.botframework.com, enable the Direct Line connector, and click on Edit. Enable the Direct Line Connector Copy the Primary Key from here

  2. Connect to the API and start the conversation, see the startConversation() function. Sends the Primary Token and receives secondary token,conversationId that you will use in your subsequent calls to Direct Line API.

  3. Send the Chat Message to Bot - sendMessageToBot(String messageText) function. This function uses the conversationId and the token received in the first authentication call and sends an Activity to the bot. In this sample we are using an activity of type "message", a message can also contain one or multiple attachments.

  4. Receiving response from Bot - Responses can be fetched from Bot by polling a GET API or use the web sockets. In this sample we have used the polling approach. function pollBotResponses - polls the GET API for conversation updates, the bot sends a JSON representation that looks like this

{ "activities": [ { "type": "message", "id": "61S2RSXVCQYKf034GmZMoT|0000001", "timestamp": "2017-01-07T12:03:38.7462471Z", "channelId": "directline", "from": { "id": "user1" }, "conversation": { "id": "61S2RSXVCQYKf034GmZMoT" }, "text": "i would like to complain about a product " }, { "type": "message", "id": "61S2RSXVCQYKf034GmZMoT|0000002", "timestamp": "2017-01-07T12:03:42.045473Z", "channelId": "directline", "from": { "id": "formbot", "name": "FormBot" }, "conversation": { "id": "61S2RSXVCQYKf034GmZMoT" }, "text": "Gee! really sorry to hear that, can you please give me the order id that looks like CRNXXXX, i would lodge a complaint in the system and someone will call you back.", "replyToId": "61S2RSXVCQYKf034GmZMoT|0000001" } ], "watermark": "2" }

this functions polls the GET API using the runnable handler which polls every 5 seconds.

Configuration Parameters - AndroidManifest.xml file

Replace the values with Relevant values

<meta-data android:name="botPrimaryToken" android:value="primarykeyofbot"/> <meta-data android:name="botName" android:value="yourbotname"/>

Things to do :

  1. The calls are synchronous in nature, need to make them asynchronous.

  2. Prepare a SDK for Android Direct Line API.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].