How to integrate rasa bot with android

@Horizon733 hi, I have gone through your tutorial for android rasa integration in YouTube, its really cool. thanks for your effort. I have a small question regarding the UI. I’m not experienced in the android development .I am trying to dive into it now a days. my question is… is it possible to display the “carousel” as I can do it in “RASA bot front(website chat widget)” do I need any additional functions to use the carousel?

Happy New year BTW

Thanks :slight_smile:

Hi @Zeusturbo Happy new year! Yes it is possible, you will have to added few lines of UI code and a few lines inside the Message class. After that check, if your python JSON payload for the carousel works with Android UI. Btw, I am working on that tutorial too. Soon will start shooting for that. Quite pack with office work.

Hi,

Thanks for the quick response. Please do let me informed. Once you done that implementation.

Thanks again… :+1: :slight_smile:

Hey @Horizon733 , I followed your New tutorial, and was able to successfully build the app, however I am getting an error when I use my ngrok public link in the retrofit section I get the following error in the logcat

> E/Message: Response{protocol=h2, code=200, message=, url=https://url.ngrok.io/webhooks/rest/webhook}

and

An exception occurred while handling user message 'None'. In the rasa terminal.

it works fine with the default url that is in the github code.

Is Rasa accessible on “https://url.ngrok.io/webhooks/rest/webhook”? YES.

Do I have to run rasa locally using some special command?

Hey @Horizon733, Please help me with the above issue.

Hi @Kookaboora, Sorry for the delayed response. You will first have to start your rasa server on your local machine, then start ngrok on the same port as rasa so it is tunnel. then replace my ngrok URL with yours. i.e. replace https://url.ngrok.io with your ngrok url.

Hey @Horizon733 , I had replaced the ngrok url, It seems the issue is with the variables we are using. I tried posting the data with Postman and when I use

{
  "message": "Hello",
  "sender": "Kookaboora"
}

It works, however, If I send

{
  "text": "Hello",
  "sender": "Kookaboora"
}

Rasa gives same error

> An exception occured while handling user message 'None'. In your project I think both the sender and receiver variables for message are named “text”. I am attaching the response I get when I use “message” variable in postman

[
    {
        "recipient_id": "Kookaboora",
        "text": "Hey! How are you?"
    },
    {
        "recipient_id": "Kookaboora",
        "text": "Please help me with your registered email ID?"
    }
]

When I rename the variable to “text”, the response is a blank array. []

I tried replacing the variable “text” in your code and I saw that the message body has the proper data which needs to be sent to rasa, but when the response is received, it shows blank in the UI, because the UI is looking for the variable “message” and in the response “text” is returned.

Is there any way to change the sending variable in your code from “text” to “message” and in the receiving(displaying the message received) end, keep the variable “text” as it is?

Thank you.

This is a greet tutorial! Thanks for this :smiley:

I made a different way

I build a web UI bot (like @akelad said) using GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront (React.js) and host it in some web server (in my case, firebase or github page)

sometimes i use this too: GitHub - JiteshGaikwad/Chatbot-Widget (HTML, JS, CSS)

Official Rasa web UI : https://rasa.com/docs/rasa/connectors/your-own-website/#chat-widget

And i load the webpage inside the app using webview WebView  |  Android Developers

Work very well using other framework like, react native, flutter, ionic

1 Like

Hi sorry for this late response, if you want to change the field name from text to message or vice versa, you will have to change it from rest.py channel code(when using rest),
if you are using socketio then another below will help you out.
link for socketio:

link for rest:

1 Like