From 453467ac9c32a25ea31a8aacea7f5168b703e6db Mon Sep 17 00:00:00 2001
From: Rich Slogar
Your Android project is now a basic "Hello World" app that contains some default files. Take a @@ -120,7 +123,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.xml
app/src/main/AndroidManifest.xml
Note 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 @@ -209,4 +215,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 912efb7..6e4605f 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 @@ -113,11 +136,11 @@ device.
<sdk>/tools/
and execute:
- android avd+
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 apply.
+ Android Studio, so the following instructions may not all apply.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. -- cgit v1.1