diff --git a/docs/html/training/basics/firstapp/creating-project.jd b/docs/html/training/basics/firstapp/creating-project.jd index 71b93c0c39056..79268a00eba33 100644 --- a/docs/html/training/basics/firstapp/creating-project.jd +++ b/docs/html/training/basics/firstapp/creating-project.jd @@ -103,10 +103,13 @@ lesson.
Activities for more information. -Your Android project is now a basic "Hello World" app that contains some default files. Take a @@ -123,7 +126,7 @@ moment to review the most important of these:
select the file you see the class definition for the activity you created. When you build and run the app, the {@link android.app.Activity} class starts the activity and loads the layout file that says "Hello World!" -app/src/res/AndroidManifest.xmlapp/src/main/AndroidManifest.xmlNote also the /res subdirectories that contain the
resources for your application:
drawable-hdpi/drawable<density>/layout/menu/values/tools/ path.sdk/ path.android list targets+
tools/android list targets
This prints a list of the available Android platforms that you’ve downloaded for your SDK. Find the platform against which you want to compile your app. Make a note of the target ID. We recommend that you select the highest version possible. You can still build your app to @@ -212,4 +218,3 @@ To run the app, continue to the next lesson.
- diff --git a/docs/html/training/basics/firstapp/running-app.jd b/docs/html/training/basics/firstapp/running-app.jd index c09669fc5840d..fdf0d1f59a534 100644 --- a/docs/html/training/basics/firstapp/running-app.jd +++ b/docs/html/training/basics/firstapp/running-app.jd @@ -83,14 +83,37 @@ from the toolbar.ant debug
platform-tools/ directory is included in your
-PATH environment variable, then execute:
-adb install bin/MyFirstApp-debug.apk
Open a command-line and navigate to the root of your project directory.
+ Use Gradle to build your project in debug mode, invoke the assembleDebug build task
+ using the Gradle wrapper script (gradlew assembleRelease).
+
+
This creates your debug .apk file inside the module build/
+ directory, named MyFirstApp-debug.apk.
On Windows platforms, type this command:
+ ++> gradlew.bat assembleDebug ++ +
On Mac OS and Linux platforms, type these commands:
+ ++$ chmod +x gradlew +$ ./gradlew assembleDebug ++ +
After you build the project, the output APK for the app module is located in
+ app/build/outputs/apk/
+
+
Note: The first command (chmod) adds the execution
+ permission to the Gradle wrapper script and is only necessary the first time you build this
+ project from the command line.
Make sure the Android SDK platform-tools/ directory is included in your
+ PATH environment variable, then execute:
+
adb install app/build/outputs/MyFirstApp-debug.apk
+
On your device, locate MyFirstApp and open it.
That's how you build and run your Android app on a device! To start developing, continue to the next @@ -114,12 +137,29 @@ device.
.<sdk>/tools/ and execute:
- android avd
in the toolbar.sdk/ and execute:
+ tools/android avd+
Note: The AVD Manager that appears + when launched from the command line is different from the version in + Android Studio, so the following instructions may not all apply.
+
+ Figure 1. The AVD Manager main screen shows your current virtual devices.
+ +
- from the toolbar.
from the toolbar.
It can take a few minutes for the emulator to load itself. You may have to unlock the screen. - When you do, My First App appears on the emulator screen.
+When you do, My First App appears on the emulator screen.ant debug
app/build/outputs/apk/.platform-tools/ directory is included in your
- PATH environment variable, then execute:
- adb install bin/MyFirstApp-debug.apk
PATH environment variable.
+ +
adb install app/build/outputs/MyFirstApp-debug.apk+ +
That's how you build and run your Android app on the emulator! +
That's how you build and run your Android app on the emulator! To start developing, continue to the next -lesson.
- - - - - - - - - + lesson.