Return to Video

Android Software Stack and Gradle - Developing Android Apps

  • 0:01 - 0:04
    The simplicity of hitting run and having your app appear on an emulator,
  • 0:04 - 0:08
    hides a lot of complexity. Remember that Android is a full software stack.
  • 0:08 - 0:12
    Adspace is a Linux Kernel,
  • 0:12 - 0:16
    which handles low level tasks like hardware fibers and panel management.
  • 0:16 - 0:21
    On top of that, are some core C and C plus plus libraries like Libsc and
  • 0:21 - 0:26
    SQLite and the Android Runtime. That includes cool Android libraries and
  • 0:26 - 0:31
    the Android virtual machines, Dalvik or more recently ART. Your apps run
  • 0:31 - 0:36
    within its own instance of the VM using the classes and services provided here
  • 0:36 - 0:41
    in the application framework. On top of that, sits the application layer,
  • 0:41 - 0:45
    which includes your app and every other app that's installed on the device. So,
  • 0:45 - 0:49
    when you hit Run in Android Studio, the first thing that happens is your code
  • 0:49 - 0:53
    gets compiled into byte code that can be run in the Android Virtual Machine.
  • 0:53 - 0:58
    That then gets installed onto the device. In Android Studio,
  • 0:58 - 1:02
    this is done using gradle, a build tool kit that manages dependencies and
  • 1:02 - 1:04
    allows you to define custom build logic.
  • 1:04 - 1:10
    You can manually start a gradle build in the IDE by selecting make project.
  • 1:10 - 1:13
    You can also do this by going to the build menu and selecting make project from
  • 1:13 - 1:17
    there, or you can use the gradle console to observe any logs or
  • 1:17 - 1:22
    build errors, or open the gradle tasks window to see any available tasks.
  • 1:22 - 1:25
    Double clicking on any of them will execute it. This will work from
  • 1:25 - 1:29
    the command line too. Once you've navigated to the root of your project folder,
  • 1:29 - 1:35
    you can run gradlew tasks to see all the tasks that you can run. You can learn
  • 1:35 - 1:39
    more about gradle by checking out the links in the instructor notes. For now,
  • 1:39 - 1:43
    note that we start with the project, which gradle then builds and
  • 1:43 - 1:48
    then packages the byte code along with the external resources such as images,
  • 1:48 - 1:53
    strings, and uixml into an application package. This is called an APK, and
  • 1:53 - 1:57
    it's a specially formatted zip file. Once you've got your APK ready to go,
  • 1:57 - 2:02
    it's signed and then pushed to the device using the Android Debug Bridge or
  • 2:02 - 2:07
    ADB. If we return to the terminal, you can see that ADB lets you interact and
  • 2:07 - 2:11
    debug apps on any device, physical or virtual. Things like pushing and
  • 2:11 - 2:14
    pulling files, viewing logcat output, or
  • 2:14 - 2:19
    even running a remote shell. So once Android's GDO has ADB installed the APK,
  • 2:19 - 2:23
    it uses ADB again to launch the app by sending a stock command via the remote
  • 2:23 - 2:27
    shell, by identifying the package and class name of your main activity.
Cím:
Android Software Stack and Gradle - Developing Android Apps
Leírás:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
UD853 - Developing Android Apps
Duration:
02:29

English subtitles

Felülvizsgálatok Compare revisions