The background,

As Google’s Flutter framework matures, more and more commercial projects are using Flutter technology, and more and more developers are learning about Flutter technology.

At this year’s Google developer conference, the Flutter framework demonstrated its cross-platform capabilities, making it easy to build apps for Android, iOS, ChromeOS and the Web.

There is an exponential growth in demand for mid-to-senior programmers, and programmers with multi-platform application development skills or familiarity with the front and back end technology stack will definitely be more competitive in this environment.

Flutter is eventually compiled as an Android or iOS project to run on the corresponding phone. Flutter is also developed based on Android Studio, XCode or other IDE, with the Flutter framework, Dart language and other related plug-ins.

To learn about Flutter development for mobile applications, you first need to be familiar with how to build an Android or iOS development environment.

Android Studio is recommended for the following reasons:

  1. Android, Android Studio and Flutter are all google-made and more compatible.
  2. IOS requires a macOS computer.
  3. IOS app packaging requires an Apple Developer account.

Second, resource preparation

First, prepare the pre-downloaded resources required to configure the Android development environment.

2.1 the Android Studio

The latest version of Android Studio is 3.5. Download the 64-bit or 32-bit version of Android Studio for your system.

Android Studio official link

The official download link may not be accessible for some reasons. You can download it from a third-party domestic site.

androiddevtools

2.2 the JDK

Android is based on Java language development, program development and compilation need Java language environment.

The new syntax for older versions of the JDK is generally not available on Android, so download 1.8 or older.

JDK Download link

2.3 Gradle

Gradle is the scripting language for Android project architecture in Android Studio. Gradle can be downloaded from the AndroidDevTools site in 2.1.

You can also download the complete version from the official website.

Download Gradle

Since Android Studio 3.0 and above is only supported for Gradle 4.4 and above, it is recommended to download it from the official (albeit slow) source.

2.4 other

Android development environment construction, also need SDK, NDK, AVD and other software packages or tools support. Android Studio will now automatically boot during the installation process, and the download speed is ok. Just follow the instructions.

Iii. Installation and configuration

Installation is not detailed, encountered problems baidu (conditional with Google) search solution.

Talk about configuring environment variables. Some of you may have just switched to writing code and don’t know what environment variables are. Briefly, after configuring global environment variables, the software executable can be found anywhere on the system.

For example, when the Android package runs to the real world, it will use ADB command tools. After configuring the platform-tools directory in the SDK as a global variable, the program can find the location of ADB tools.

Of course, you can also configure the path of the SDK tools in the IDE, which is what you do in Android Studio.

3.1 Process for Configuring environment Variables

  1. In Windows 10, right-click the desktop “this computer” icon (Win 7 and below is “my computer”).

  1. Click “properties”, properties of the “advanced system Settings”, Win10 following system page may be different.

  1. On the TAB that opens, click Environment Variables.

  1. It can be configured in the Path parameter in User Variables or System Variables. If the current computer has multiple users, the configuration in the system variable will take effect for each user environment.

  2. In Windows, the Path is usually the bin directory in the software package.

    3.2 Environment Variables to Be Configured

    It is in the resources downloaded above.

    1. The JDK directory
    2. Gradle directory
    3. Tools directory under the SDK
    4. The platform-tools directory under the SDK
    5. The NDK directory

    Note: The environment variables configured are not intended for use in Android Studio. In The Android Studio Settings, the path of the related packages is configured. Call them directly as a full path.

    Environment variables, more commonly used in CMD or shell command line tools, can be called from any directory in the system.

First Android project

  1. Once Android Studio is installed, this page comes first. Click “Start a new Android Studio Project”.

  2. Select Empty Activity.

  3. Fill in the application name, package name (only one APP with the same package name can be installed on a mobile phone), project storage path, development language (Java or Kotlin), and the lowest supported Android system (generally 5.0 or above, which can be guaranteed to cover most mobile phones). After the configuration is complete, click Finish.

  4. Wait patiently for the project to be created and the index creation to complete. Click the Run button in the upper right corner to select the running device. Select run on virtual machine. The real phone needs to connect the phone to the computer and turn on the debug mode.

  5. Wait until the project is compiled and packaged and successfully run to the virtual machine.

  6. Congratulations on running your first Android project.

Five, the summary

  1. Download the resources required to configure the Android development environment.
  2. Configuration of environment variables.
  3. Create and run your first Android project.

Learn about “Autism Bug” and get free Android, Python, Java learning materials.