Hi everyone/<@U08CKJH7C12>...Is there any detail d...
# agents
w
Hi everyone/@refined-appointment-81829...Is there any detail document to run livekit voice agent as android app in mobile other than github source? As very less information in github source and after following it, I am not able to run it suceessfully. Thanks
✅ 1
l
Hi Jalpa, the agent needs to run on a server, and would be written in either Python or TS - we don't support running the agent as an android app. All of the docs around Android are to use it as a front end to communicate with the agent, so the steps would be: • Create an agent and have it running in the cloud. It's sufficient to follow this guide, https://docs.livekit.io/agents/start/voice-ai/, and get as far as running
uv run agent.py dev
• Create a token server, and then build and run the Android starter project to act as the front end - both of these steps are in the ReadMe of https://github.com/livekit-examples/agent-starter-android If anything goes wrong, be sure to check the LiveKit API keys are the same between your agent and Android app. Also ensure that your Android source has a token server defined --> all of this should happen automatically when you run the
lk
CLI, but it's good to check.
w
Hi @lively-winter-88668 using gitbash i am able to clone the android starter project but facing this issue while opening in android studio "The project is using an incompatible version (AGP 8.13.0) of the Android Gradle plugin. Latest supported version is AGP 8.9.2 See Android Studio & AGP compatibility options."
l
Did you run the AGP upgrade assistant? I ignored the popup the suggested I update and it seemed to build OK.
w
Hi @lively-winter-88668 thanks for your quick reply. I have debugged the issues and able to build the app and run the app using this source https://github.com/livekit-examples/agent-starter-android. But now when I start call then I am not able to hear any sound. Does this code need to be integrated with other code to make it work? thanks
l
So, the full end-to-end steps to get something running with the Android front end would be as follows: 1. Create an agent in either Python or Node.js from one of the two starter projects: https://docs.livekit.io/agents/start/voice-ai/ 2. Deploy this agent to a room, for example in Python run
uv run agent.py dev
3. Test your agent is in the room - you can use the Playground for this, https://agents-playground.livekit.io/, and talk to your agent from your browser 4. Create a sandbox token server (cloud.livekit.io --> Sandbox --> Token server). Once you have the sandbox token server created and started, take a note of the Sandbox ID 5. Add the Sandbox ID to
TokenExt.kt
, as specified in the starter readme: https://github.com/livekit-examples/agent-starter-android. 6. Run your Android app, and it should be able to speak to your agent. Double check you have microphone permission enabled, and if running on an emulator, be sure the mic and speakers for the emulator are enabled
w
Thanks @lively-winter-88668 for your quick help. Its working.