Android Setup
- Install Android Studio
- Configure Android Studio
- Android Phone Setup (required for lab computers)
- (Optional) Android Emulator Setup
- Installing Visual Studio Code
- Testing your setup
If you work on Windows, you must use Android even if you own an iPhone. You must have a Mac to develop for iPhone.
Install Android Studio
On your personal computer
- Go to https://developer.android.com/studio and click the “Download Android Studio” button. Accept the license and download the file.
- Run the file and accept the default settings.
- The ‘Android Studio Setup Wizard’ will pop-up. Select “Standard Installation” and all default options. This will install a variety of tools needed to compile Android programs. You will need to accept some Android licenses. This installation will take a very long time.
On a lab computer
- Go to https://developer.android.com/studio#android-studio-downloads.
- Scroll way down to select the file
android-studio-2024.2.1.12-windows.zip
(no .exe installer) next to Windows (64-bit). Accept the license and download the file. - Unzip the file (Right click->Extract All) into the current directory, which should create a folder named
android-studio
. If not, look for theandroid-studio
directory inside the directory created when you unzipped. - Move
android-studio
folder to your%HOME%
folder so that you have%HOME%\android-studio\
. - Browse to the file
%HOME%\android-studio\bin\studio64.exe
. Drag this file to your windows task bar, or right-click it and “Create a Desktop Shortcut”. - Run Android Studio (
studio64.exe
) - A Wizard will pop-up saying you need to install an SDK. Click through the installer with the default options.
Android Studio should look like this after you have completed the installation:
Configure Android Studio
From the screen above:
- More Actions -> SDK Manager
- Select the SDK Tools tab
- Check the boxes next to:
- Android SDK Command-line tools
- Google USB Driver
- Click “OK” to install. You may have to accept some licenses.
- Once everything is done, click Finish.
Android Phone Setup (required for lab computers)
This is required for lab computers in CG 2055.
If you have an Android phone you would like to use, follow https://docs.flutter.dev/get-started/install/windows/mobile?tab=physical#configure-your-target-android-device
(Optional) Android Emulator Setup
This is not available for lab computers. You can set up an Android emulator, which is a simulated phone that runs in Android Studio that you can interact and test with. This is very handy, so you should at least try it.
Follow all of the instructions in the “Configure your target Android device” section of https://docs.flutter.dev/get-started/install/windows/mobile?tab=virtual#configure-your-target-android-device
Installing Visual Studio Code
We will use Visual Studio Code to write our Flutter apps. We could use Android Studio, but it requires a lot of RAM as do other essential tools like the emulator/simulator. So, we’ll use VS Code for the benefit of those with limited RAM.
Follow the instructions here: https://docs.flutter.dev/get-started/editor?tab=vscode.
Testing your setup
- Create a folder in your %HOME% directory called
flutter_projects
- Follow the instructions for Test Drive: https://docs.flutter.dev/get-started/test-drive?tab=vscode with the following modifications:
- When asked to Select a folder to create the project in, select the
flutter_projects
folder you created. - For a quick and dirty test, you can use a Web Browser as the target device.
- If you’re developing for iOS, you’ll need to launch an iOS simulator as in the instruction page.
- If you’re developing for Android, you should see the options to pick an Android Emulator device to run on.
- When asked to Select a folder to create the project in, select the
- Running/Debug will begin the process of compiling and running the Flutter project. This process will take a long time the first time you do it, but should be faster after that. You should see some output appear in the “Debug Console”. The Debug Console will likely show a lot of things being downloaded – this is okay, and also why it’s taking so long. Be patient.