DEV Community

Cover image for Utilize AI-powered Tools Amazon CodeWhisperer and Amazon Q in Visual Studio Code on Android Devices
Jimmy for AWS Community Builders

Posted on • Edited on

Utilize AI-powered Tools Amazon CodeWhisperer and Amazon Q in Visual Studio Code on Android Devices

While traveling, it can be challenging to carry a laptop everywhere, especially if you want to do some coding or testing. What if we could work solely using our mobile devices, particularly Android devices to run Visual Studio Code, and have AI-powered tools to assist in coding tasks?

In this article, we will explore how we can utilize AI-powered tools Amazon CodeWhisperer and Amazon Q in Visual Studio Code on Android Devices.

Amazon CodeWhisperer

amazon codewhisperer

CodeWhisperer is an AI-powered productivity tool that generates real-time, single-line, or full-function code suggestions in your integrated development environment (IDE) and in the command line to help you quickly build software. With CodeWhisperer, you can write a comment in natural language that outlines a specific task in English, such as, “Upload a file with server-side encryption.” Based on this information, CodeWhisperer recommends one or more code snippets directly in the IDE that can accomplish the task. You can quickly and easily accept the top suggestion (tab key), view more suggestions (arrow keys), or continue writing your own code. You should always review a code suggestion before accepting it, and you might need to edit it to ensure that it does exactly what you intended.

Amazon Q

amazon q

Amazon Q is a new type of generative AI–powered assistant. It is specifically for work and can be tailored to your business to have conversations, solve problems, generate content, and take action using the data and expertise found in your company's information repositories, code bases, and enterprise systems. Amazon Q provides quick, relevant, and actionable information and advice to help streamline tasks, speed decision-making and problem-solving, and help spark creativity and innovation at work.

Termux

Termux is an open-source terminal emulator for Android that also acts as a Linux-like environment. It provides a Linux-like terminal on Android devices, allowing users to run a wide range of Linux tools and utilities directly on their smartphones or tablets. Termux is designed to bring a powerful and flexible Linux command-line experience to Android users.

Install and Configure Termux

  • Download Termux latest version.
    download termux

  • After the download is complete, Install Termux by enabling Install unknown apps in Chrome.

enable unknown apps

Code Server (VS Code in the browser)

code server

Code Server is an open-source project that allows you to run Visual Studio Code (VS Code) in a remote server environment, accessible through a web browser. VS Code is a popular source code editor developed by Microsoft, known for its lightweight and extensible nature.

With Code Server, you can set up an instance of VS Code on a remote server or cloud environment and then access it from your local machine through a web browser. This enables you to develop and edit code on a powerful server while using a more lightweight device for the actual editing and visualization.

Install Code Server

  • Run Termux, first run pkg update

pkg update

  • Then run pkg install tur-repo

pkg install tur repo

  • Then run pkg install code-server to install the Code Server.

pkg install code-server

Run Code Server

  • Run this command code-server --auth none in Termux

code-sever --auth none

  • While keeping the Termux running, go to your browser (chrome) then type localhost:8080, you will then get directed to Visual Studio Code IDE.

vscode

AWS Toolkit for Visual Studio Code

The AWS Toolkit for Visual Studio is an extension for Microsoft Visual Studio running on Microsoft Windows that makes it easier for developers to develop, debug, and deploy .NET applications using Amazon Web Services. With the AWS Toolkit for Visual Studio, you'll be able to get started faster and be more productive when building AWS applications.

The AWS Toolkit for Visual Studio is available via the Visual Studio Marketplace and supports Visual Studio 2022, 2019, and 2017. The AWS Toolkit for 2013 and 2015 is contained in the AWS SDK and Tools for .NET install package.

Install AWS Toolkit

  • Go to Extension, then search for aws toolkit

aws toolkit

  • Click Install

Sometimes, Installing the extension can fail, so you need to install the extension manually. You can follow the instructions provided by Visual Studio Code.

Authenticating AWS Toolkit extension

  • Connect with AWS

authenticating

  • Proceed to Browser.

browser

  • Confirm the Authorization request and continue.

confirm auth

  • After that, you need to log in with your AWS Builder account, and if you don't have one, you can create one.

  • Allow AWS Toolkit for VSCode.

aws toolkit

  • If successful, you will then see Amazon Q and AWS Toolkit extensions appear in the bottom left sidebar on your VSCode. And you can start using it.

sidebar

Using Amazon Q

To start using Amazon Q you can just start typing the question you want to ask and Amazon Q will answer it for you, like this.

amazon q

Using Amazon CodeWhisperer.

To start using Amazon CodeWhisperer you can create a javascript file and then start creating a function. CodeWhisperer will generate the complete function for you like this.

amazon codewhisperer

Add Code Server as an Application

install code server

You can install your Code Server on your Android device by clicking this menu.

instll code-server

If successful, you can then run your Code Server fullscreen like other Native Android applications.

code server fullscreen

Conclusions

In conclusion, the integration of Code Server along with AI-powered tools like Amazon Q and Amazon CodeWhisperer enables us to seamlessly engage in coding activities directly from our Android devices. This innovative combination not only enhances flexibility during travel but also provides a powerful and efficient coding environment.

Check out my other post

Top comments (0)