Utilize AI-powered Tools Amazon CodeWhisperer and Amazon Q in Visual Studio Code on Android Devices
Tags: vscode, ai, mobile, aws
Published: 2024-01-23 21:08:36

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhs2r7gbwmnts48zyqbt.png)

[CodeWhisperer](https://aws.amazon.com/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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3b4kcsr6b48vvrki2xip.png)

[Amazon Q](https://aws.amazon.com/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](https://f-droid.org/en/packages/com.termux/) Termux latest version.
![download termux](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/883qeg33r195y5k1ws24.png)

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

![enable unknown apps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blhpltmlk9895xex45sk.png)

## Code Server (VS Code in the browser)

![code server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/enowfghdshz4y6ywzl20.png)


[Code Server](https://github.com/coder/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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/my3q9bsstxhe57hj8py0.jpg)

-  Then run `pkg install tur-repo`

![pkg install tur repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/it7h4j4o2r0eq0c7suub.jpg)

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

![pkg install code-server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wehv8w1obu3ucll6r2gr.jpg)

## Run Code Server
- Run this command `code-server --auth none` in Termux

![code-sever --auth none](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7z8axjd2fvujtiy9qyu2.jpg)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40ms5g0omunyznbv28qr.jpg)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxv9tvq7arhdlcgep5qu.jpg)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/id2turn88hdgyj6fz527.jpg)

- Proceed to Browser.

![browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pme31a7hdnk6w4swvwb7.jpg)

- Confirm the Authorization request and continue.


![confirm auth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77afxr5bx0a2nwr7uxza.jpg)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecl5owtdko6zq07966pr.jpg)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pg9dkwoz62wmrypsv7d9.jpg)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghk81dhyrs3c1fz2h434.jpg)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8pd04ets20lllvag0sn.jpg)

## Add Code Server as an Application

![install code server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5e9j6ay200onj45ktse.png)

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


![instll code-server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i6w70ajfr0ywz03bagec.png)



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


![code server fullscreen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwafjd9cgwe40cnonu3w.png)



## 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
{% embed https://dev.to/aws-builders/stream-amazon-bedrock-response-with-aws-lambda-response-streaming-59en %}