官术网_书友最值得收藏!

Running your first Android application

We made our first screen and defined some specifics for the application itself. To be sure that what we did so far is ok, we do the build and run our application. We will run the completeDebug build variant. If you forgot how to switch to this build variant, we will remind you. Open Android Studio and the Journaler project. Open the Build Variants pane by clicking on the Build Variants pane on the left side of the Android Studio window or by choosing View |Tool Windows | Build Variants. The Build Variants pane will appear. Choose completeDebug from the drop-down list, as shown in the screenshot:

We will use this Build Variant as our main build variant for the try out execution, and for production build, we will use the completeDebug build variant. After we choose Build Variant from the drop-down list, it takes some time for Gradle to build the chosen variant.

We will run our application now. We will do it on an emulator first and then on a real live device. Start your emulator instance by opening the AVD Manager. We will open it by clicking on the AVD Manager icon. It is the fastest way to open it. Double-click on the AVD instance. It will take some time until your emulator is ready. Emulator performs Android system boot and then it loads a default application launcher.

Your emulator is booted and ready to run the application. In order to run the application, click on the Run icon or navigate to RunRun 'app'.

There is a keyboard shortcut for this; on macOS, it is Ctrl + R.

When an application runs, a dialog box for Select Deployment Target appears. In case you have multiple instances on which an application can run, you can choose one of them as shown in the following screenshot:

Pick your deployment target and click on OK. In case you want to remember your selection, check the Use same selection for future launches selection. It takes some time for the application to run, but after a few seconds, your application appears!

主站蜘蛛池模板: 绥芬河市| 全南县| 万年县| 上杭县| 曲麻莱县| 霍林郭勒市| 台北市| 宣城市| 买车| 衡水市| 如皋市| 乌兰浩特市| 新野县| 大冶市| 崇阳县| 卓尼县| 西畴县| 麦盖提县| 高碑店市| 丹东市| 元朗区| 岳阳市| 南安市| 丘北县| 会昌县| 叶城县| 绩溪县| 平安县| 麻城市| 屏南县| 兰州市| 洪泽县| 乐至县| 神农架林区| 赤峰市| 毕节市| 泰兴市| 含山县| 尼木县| 平定县| 民县|