AI arrives on Android Studio! — Meet Studio Bot!

Really exciting times ahead!

The Android Developer
7 min readMay 11, 2023

Introduction

Hello everyone👋! Hope you’re doing well! As of writing this, it's Google I/O 2023 week, and there are a lot of interesting announcements being made! In this article, I will go over one of the most exciting updates coming to Android Studio.

Besides the other updates to Android Studio, such as the revamped logos and support of Android Vitals in Android Studio, they also announced “Studio Bot” — an AI-powered chatbot that is gonna be directly integrated into Android Studio. I will be specifically going over this feature in this article and why I think it would be a major productivity boost for us, Android Developers.

It’s just another Chatbot, what’s the difference between using this and some other chatbot that’s already available? 🤷

This might be a question that you might be having right now. Before you think any further, let me break it down for you. While yes, it’s yet another chatbot, it has a few tricks up its sleeve that make it especially easier for Android Developers to use it over other chatbots. I’ll go over a few features that make it really fun to use it.

It’s directly built into the IDE and is specifically designed to answer questions related to Android Development 🧑‍💻

Studio Bot will be directly built into the IDE as a tool window. This might seem trivial, but it’d be very convenient because you don’t need to be switching between applications back and forth.

Image of the Studio Bot tool window in Android Studio Hedgehog

More importantly, it’s specifically designed to answer Android-centric questions. This means, it has access to the official documentation, which is huge because you can now ask questions directly from Android Studio. Studio Bot can cut out all the slack and give you a focused and precise answer to your question! Here’s a sample scenario of how this could be very useful.

In Android, there are a couple of Bluetooth permissions. Each permission would give your app the permission to perform a specific task related to Bluetooth such as — enabling device discovery or connecting to a new device. Let’s say you want to add Bluetooth permissions to your app.

If you were to do it the traditional way, you’d have to switch over to your browser, type the search query, check out the official documentation, and sift through all the things that you don’t care about until you finally get to the section where the article talks about the different types of Bluetooth permissions in Android and how to use them. Once you read the documentation, you'd have to copy every single permission that matches your app’s use case and add it to your manifest. Phew! That’s a lot of work!

Now, if you were to use Studio Bot, you can just type the query and the bot would immediately show you the permissions that need to be added, with the part of the documentation that explains what each permission is! You can even insert the permissions directly into your app’s manifest, by just clicking a single button! Boom! That’s it! It’s that easy!

A superpower to debug errors! 🦸‍♂️

If you get an error in logcat, you no longer need to search the internet for possible solutions. Just right-click on the error and ask about it to Studio Bot! That’s it!

Ask questions to Studio Bot by right-clicking on the error in logcat
Debugging errors become much easier when using Studio Bot

Code generation ✍️

Similar to other bots, Studio Bot can also generate code. But, adding the code generated by Studio Bot would be much easier because you can add the generated code with just a click of a button. This might not seem big until you realize the potential of it. Tasks like adding dependencies and permissions become extremely easy. Just ask it what you want and add it to your code base. It’s as simple as that!

Generated code by Studio Bot can be easily added to the codebase

In this example taken from the official Android documentation for Studio Bot, we can see how it not only explains how to add a dark theme in Jetpack compose, but also gives the relevant dependencies that are required for compose. And, it doesn't stop there. It even allows you to add the dependencies and the generated code directly into your app’s codebase with just a click of a button! That’s soo cool, isn't it?!

Generate Unit Tests 🧪

Studio Bot can generate unit tests for your code. Just ask it to generate the tests, give it a few seconds, and boom! The tests get generated! What’s more is that, with a click of a button, it automatically adds the tests to the correct source set! It’s also contextually aware, which means, you can follow up with questions. This implies that you can not only generate code using Studio Bot, but also ask it to generate tests for the generated code! How cool is that!

Better naming suggestions 🔮

We all know that as developers, one of the most challenging things in software development is naming things 😅. It’s a simple concept, yet most of us struggle with it more times than we would like to admit. But worry not, Studio Bot can help you with that as well!

Studio Bot can also assist in naming things

The playground environment 🛝

Want to try out the code that was generated by Studio Bot, but you’re too afraid to add it to your actual codebase? Welp, Android Studio helps you with that as well! Just click the “Explore in playground” button and it’ll add the generated code to a separate file where you can try it out in an isolated manner.

Trying out Studio Bot 🤖

So, after hearing all the awesome things about Studio Bot, you really wanna try it out, is it? I too wanna try it out! But, unfortunately, as of writing this article, Studio Bot is only available for developers in US. If you’re in the US, you can try it out by downloading Android Studio — Hedgehog, which is currently available in the Canary channel.

Studio Bot is only available in the US as of writing this article

A small personal note on AI 📝

As Sundar pichai mentioned at Google I/O— We are at an influxion point. And I couldn't agree more. AI is changing the world right in front of our eyes. As developers, we have to learn to take advantage of all the benefits that AI provides us with, and solve bigger problems. I will leave you all with a quote that I often come back to, when I talk about AI.

“ AI will not replace the jobs of people. But, the people who learn to use AI to their advantage, will. ”

Conclusion

And, that wraps up this blog post🎉! You would’ve probably gotten an idea of how excited I am for Studio Bot. I can’t wait to try it out! I think it will really be an invaluable tool for Android Developers.

As always, hopefully, you found this blog post helpful! If you liked this article, feel free to check out my other articles as well. I would like to thank you for taking the time to read this article😊. I wish you the best of luck! Happy coding 👨‍💻! Go create some awesome Android apps 👨‍💻! Cheers!

If you really liked my article and want to support me, you can do so, by clicking this link. Thank you so much for being generous ❤️, it really motivates me to keep going, and it helps me to keep my articles free for anyone to read. If you don’t feel like supporting, that’s fine too! The fact that you took some time off your schedule to read my article means a lot to me. Thank you 🙂

--

--

The Android Developer

| A very passionate Android Developer 💚 | An extreme Kotlin fanatic 💜 | A huge fan of Jetpack Compose 💙| Focused on making quality blog posts 📝 |