Slide 25
Slide 25 text
Android Setup
Install Android Studio
▶ Download and install Android Studio version 3.0 or later. (bit.ly/androidstudio_download)
▶ Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This will install the latest Android SDK, Android SDK Platform-Tools, and Android SDK
Build-Tools, which are required by Flutter when developing for Android
Set up your Android device
To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.
▶ Enable Developer options and USB debugging on your device.
▶ Windows-only: Install the Google USB Driver. (bit.ly/googleusbdriver)
▶ Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
▶ In the terminal, run the “$ flutter device” command to verify that Flutter recognizes your connected Android device.
Set up the Android emulator
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
▶ Launch Android Studio>Tools>Android>AVD Manager and select Create Virtual Device. (The Android submenu is only present when inside an Android project.)
▶ Choose a device definition and select Next.
▶ Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
▶ Save Your AVD Name in a notepad
▶ Verify the AVD configuration is correct, and select Finish.
▶ Locate your emulator folder in your android sdk folder (e.g. C:\Users\HP\AppData\Local\Android\sdk\emulator)
▶ Copy the path (e.g. C:\Users\HP\AppData\Local\Android\sdk\emulator)
▶ Add the path as a User Variable at your User Path just like you did when adding “flutter\bin” to your Path
▶ In the terminal, run “$ emulator –avd {YOUR_AVD_NAME}” command to start your visual machine
▶ In the terminal, run the “$ flutter device” command to verify that Flutter recognizes your avd.