diff --git a/docs/html-intl/intl/es/preview/j8-jack.jd b/docs/html-intl/intl/es/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/es/preview/j8-jack.jd rename to docs/html-intl/intl/es/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/es/preview/_book.yaml b/docs/html-intl/intl/es/preview/_book.yaml index 815f0f6fb5ef0..e64ba5a7e9bda 100644 --- a/docs/html-intl/intl/es/preview/_book.yaml +++ b/docs/html-intl/intl/es/preview/_book.yaml @@ -260,27 +260,6 @@ toc: value: ICU4J Android 框架 API - name: zh-tw-lang value: ICU4J Android 架構 API - - title: Funciones del lenguaje Java 8 - path: /preview/j8-jack.html - path_attributes: - - name: es-lang - value: Funciones del lenguaje Java 8 - - name: in-lang - value: Fitur Bahasa Java 8 - - name: ja-lang - value: Java 8 の機能 - - name: ko-lang - value: Java 8 언어 기능 - - name: pt-br-lang - value: Recursos de linguagem do Java 8 - - name: ru-lang - value: Возможности языка Java 8 - - name: vi-lang - value: Tính năng của Ngôn ngữ Java 8 - - name: zh-cn-lang - value: Java 8 语言功能 - - name: zh-tw-lang - value: Java 8 語言功能 - title: Actualizaciones para Android for Work path: /preview/features/afw.html - title: Acceso a directorios determinados diff --git a/docs/html-intl/intl/in/preview/j8-jack.jd b/docs/html-intl/intl/in/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/in/preview/j8-jack.jd rename to docs/html-intl/intl/in/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/in/preview/_book.yaml b/docs/html-intl/intl/in/preview/_book.yaml index 88d6c715666d0..171b8ca330bc0 100644 --- a/docs/html-intl/intl/in/preview/_book.yaml +++ b/docs/html-intl/intl/in/preview/_book.yaml @@ -260,27 +260,6 @@ toc: value: ICU4J Android 框架 API - name: zh-tw-lang value: ICU4J Android 架構 API - - title: Fitur Bahasa Java 8 - path: /preview/j8-jack.html - path_attributes: - - name: es-lang - value: Funciones del lenguaje Java 8 - - name: in-lang - value: Fitur Bahasa Java 8 - - name: ja-lang - value: Java 8 の機能 - - name: ko-lang - value: Java 8 언어 기능 - - name: pt-br-lang - value: Recursos de linguagem do Java 8 - - name: ru-lang - value: Возможности языка Java 8 - - name: vi-lang - value: Tính năng của Ngôn ngữ Java 8 - - name: zh-cn-lang - value: Java 8 语言功能 - - name: zh-tw-lang - value: Java 8 語言功能 - title: Pembaruan Android for Work path: /preview/features/afw.html - title: Scoped Directory Access diff --git a/docs/html-intl/intl/ja/preview/j8-jack.jd b/docs/html-intl/intl/ja/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/ja/preview/j8-jack.jd rename to docs/html-intl/intl/ja/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/ja/preview/_book.yaml b/docs/html-intl/intl/ja/preview/_book.yaml index 5f1e18fd8ba09..68886478aa1d6 100644 --- a/docs/html-intl/intl/ja/preview/_book.yaml +++ b/docs/html-intl/intl/ja/preview/_book.yaml @@ -260,27 +260,6 @@ toc: value: ICU4J Android 框架 API - name: zh-tw-lang value: ICU4J Android 架構 API - - title: Java 8 の言語機能 - path: /preview/j8-jack.html - path_attributes: - - name: es-lang - value: Funciones del lenguaje Java 8 - - name: in-lang - value: Fitur Bahasa Java 8 - - name: ja-lang - value: Java 8 の機能 - - name: ko-lang - value: Java 8 언어 기능 - - name: pt-br-lang - value: Recursos de linguagem do Java 8 - - name: ru-lang - value: Возможности языка Java 8 - - name: vi-lang - value: Tính năng của Ngôn ngữ Java 8 - - name: zh-cn-lang - value: Java 8 语言功能 - - name: zh-tw-lang - value: Java 8 語言功能 - title: Android for Work のアップデート path: /preview/features/afw.html - title: 特定のディレクトリへのアクセス diff --git a/docs/html-intl/intl/ko/preview/j8-jack.jd b/docs/html-intl/intl/ko/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/ko/preview/j8-jack.jd rename to docs/html-intl/intl/ko/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/ko/preview/_book.yaml b/docs/html-intl/intl/ko/preview/_book.yaml index 17b1d963fd5b7..4a43a4f8b7d6c 100644 --- a/docs/html-intl/intl/ko/preview/_book.yaml +++ b/docs/html-intl/intl/ko/preview/_book.yaml @@ -260,27 +260,6 @@ toc: value: ICU4J Android 框架 API - name: zh-tw-lang value: ICU4J Android 架構 API - - title: Java 8 언어 기능 - path: /preview/j8-jack.html - path_attributes: - - name: es-lang - value: Funciones del lenguaje Java 8 - - name: in-lang - value: Fitur Bahasa Java 8 - - name: ja-lang - value: Java 8 の機能 - - name: ko-lang - value: Java 8 언어 기능 - - name: pt-br-lang - value: Recursos de linguagem do Java 8 - - name: ru-lang - value: Возможности языка Java 8 - - name: vi-lang - value: Tính năng của Ngôn ngữ Java 8 - - name: zh-cn-lang - value: Java 8 语言功能 - - name: zh-tw-lang - value: Java 8 語言功能 - title: Android for Work 업데이트 path: /preview/features/afw.html - title: 범위가 지정된 디렉터리 액세스 diff --git a/docs/html-intl/intl/pt-br/preview/j8-jack.jd b/docs/html-intl/intl/pt-br/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/pt-br/preview/j8-jack.jd rename to docs/html-intl/intl/pt-br/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/pt-br/preview/_book.yaml b/docs/html-intl/intl/pt-br/preview/_book.yaml index 8f75c9ae6b827..d4af8e178ba5b 100644 --- a/docs/html-intl/intl/pt-br/preview/_book.yaml +++ b/docs/html-intl/intl/pt-br/preview/_book.yaml @@ -260,27 +260,6 @@ toc: value: ICU4J Android 框架 API - name: zh-tw-lang value: ICU4J Android 架構 API - - title: Recursos de linguagem do Java 8 - path: /preview/j8-jack.html - path_attributes: - - name: es-lang - value: Funciones del lenguaje Java 8 - - name: in-lang - value: Fitur Bahasa Java 8 - - name: ja-lang - value: Java 8 の機能 - - name: ko-lang - value: Java 8 언어 기능 - - name: pt-br-lang - value: Recursos de linguagem do Java 8 - - name: ru-lang - value: Возможности языка Java 8 - - name: vi-lang - value: Tính năng của Ngôn ngữ Java 8 - - name: zh-cn-lang - value: Java 8 语言功能 - - name: zh-tw-lang - value: Java 8 語言功能 - title: Atualizações no Android for Work path: /preview/features/afw.html - title: Acesso a diretórios com escopo diff --git a/docs/html-intl/intl/ru/preview/j8-jack.jd b/docs/html-intl/intl/ru/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/ru/preview/j8-jack.jd rename to docs/html-intl/intl/ru/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/vi/preview/j8-jack.jd b/docs/html-intl/intl/vi/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/vi/preview/j8-jack.jd rename to docs/html-intl/intl/vi/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/zh-cn/preview/j8-jack.jd b/docs/html-intl/intl/zh-cn/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/zh-cn/preview/j8-jack.jd rename to docs/html-intl/intl/zh-cn/guide/platform/j8-jack.jd diff --git a/docs/html-intl/intl/zh-cn/preview/_book.yaml b/docs/html-intl/intl/zh-cn/preview/_book.yaml index 81956eda37f4b..fe44ea81ad9db 100644 --- a/docs/html-intl/intl/zh-cn/preview/_book.yaml +++ b/docs/html-intl/intl/zh-cn/preview/_book.yaml @@ -260,27 +260,6 @@ toc: value: ICU4J Android フレームワーク API - name: zh-tw-lang value: ICU4J Android フレームワーク API - - title: Java 8 语言功能 - path: /preview/j8-jack.html - path_attributes: - - name: es-lang - value: Funciones del lenguaje Java 8 - - name: in-lang - value: Fitur Bahasa Java 8 - - name: ja-lang - value: Java 8 の機能 - - name: ko-lang - value: Java 8 언어 기능 - - name: pt-br-lang - value: Recursos de linguagem do Java 8 - - name: ru-lang - value: Возможности языка Java 8 - - name: vi-lang - value: Tính năng của Ngôn ngữ Java 8 - - name: zh-cn-lang - value: Java 8 の機能 - - name: zh-tw-lang - value: Java 8 の機能 - title: Android for Work Updates path: /preview/features/afw.html - title: 作用域目录访问 diff --git a/docs/html-intl/intl/zh-tw/preview/j8-jack.jd b/docs/html-intl/intl/zh-tw/guide/platform/j8-jack.jd similarity index 100% rename from docs/html-intl/intl/zh-tw/preview/j8-jack.jd rename to docs/html-intl/intl/zh-tw/guide/platform/j8-jack.jd diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml index 850712857ad9b..89f43d8a1e86b 100644 --- a/docs/html/_redirects.yaml +++ b/docs/html/_redirects.yaml @@ -1220,4 +1220,5 @@ redirects: to: /guide/topics/ui/notifiers/notifications.html - from: /preview/features/multilingual-support.html to: /guide/topics/resources/multilingual-support.html - +- from: /preview/j8-jack.html + to: /guide/platform/j8-jack.html \ No newline at end of file diff --git a/docs/html/guide/_book.yaml b/docs/html/guide/_book.yaml index 0f3db799b8f68..9d5c3e1247dc6 100644 --- a/docs/html/guide/_book.yaml +++ b/docs/html/guide/_book.yaml @@ -9,6 +9,33 @@ toc: - title: System Permissions path: /guide/topics/security/permissions.html +- title: Platform Architecture + path: /guide/platform/index.html + section: + - title: Use Java 8 Language Features + path: /guide/platform/j8-jack.html + path_attributes: + - name: es-lang + value: Funciones del lenguaje Java 8 + - name: in-lang + value: Fitur Bahasa Java 8 + - name: ja-lang + value: Java 8 の機能 + - name: ko-lang + value: Java 8 언어 기능 + - name: pt-br-lang + value: Recursos de linguagem do Java 8 + - name: ru-lang + value: Возможности языка Java 8 + - name: vi-lang + value: Tính năng của Ngôn ngữ Java 8 + - name: zh-cn-lang + value: Java 8 语言功能 + - name: zh-tw-lang + value: Java 8 語言功能 + - title: Verifying App Behavior on the Android Runtime (ART) + path: /guide/practices/verifying-apps-art.html + - title: App Components path: /guide/components/index.html section: @@ -422,5 +449,3 @@ toc: path: /guide/practices/screen-compat-mode.html - title: Supporting Tablets and Handsets path: /guide/practices/tablets-and-handsets.html - - title: Verifying App Behavior on ART - path: /guide/practices/verifying-apps-art.html diff --git a/docs/html/guide/platform/Images/android-stack_2x.png b/docs/html/guide/platform/Images/android-stack_2x.png new file mode 100644 index 0000000000000..33bb14414d912 Binary files /dev/null and b/docs/html/guide/platform/Images/android-stack_2x.png differ diff --git a/docs/html/guide/platform/index.jd b/docs/html/guide/platform/index.jd new file mode 100644 index 0000000000000..9aed4611c7ddd --- /dev/null +++ b/docs/html/guide/platform/index.jd @@ -0,0 +1,217 @@ +page.title=Platform Architecture +page.keywords=platform,architecture,framework +@jd:body + + +
+ Android is an open source, Linux-based software stack created for a wide + array of devices and form factors. The following diagram shows the major + components of the Android platform. +
+ +
++ Figure 1. The Android software stack. +
+ ++ The foundation of the Android platform is the Linux kernel. For example, + the Android Runtime (ART) relies on the Linux kernel for + underlying functionalities such as threading and low-level memory management. +
+ ++ Using a Linux kernel allows Android to take advantage of key + security features and allows device manufacturers to develop hardware + drivers for a well-known kernel. +
+ ++ The + hardware abstraction layer (HAL) provides standard interfaces that expose + device hardware capabilities to the higher-level Java API framework. The HAL consists of multiple library + modules, each of which implements an interface for a specific type of hardware + component, such as the camera or bluetooth module. + When a framework API makes a call to access device hardware, the Android + system loads the library module for that hardware component. +
+ ++ For devices running Android version 5.0 (API level 21) or higher, each app + runs in its own process and with its own instance of the Android Runtime + (ART). ART is written to run multiple virtual machines on low-memory + devices by executing DEX files, a bytecode format designed specially for + Android that's optimized for minimal memory footprint. Build toolchains, such + as Jack, compile + Java sources into DEX bytecode, which can run on the Android platform. +
+ ++ Some of the major features of ART include the following: +
+ ++ Prior to Android version 5.0 (API level 21), Dalvik was the Android runtime. + If your app runs well on ART, then it should work on Dalvik as well, but + the reverse may not be + true. +
+ ++ Android also includes a set of core runtime libraries that provide most of + the functionality of the Java programming language, including some Java 8 language features, that the Java + API framework uses. +
+ ++ Many core Android system components and services, such as ART and HAL, are + built from native code that require native libraries written in C and C++. + The Android platform provides Java framework APIs to expose the functionality + of some of these native libraries to apps. For example, you can access + OpenGL ES through the + Android framework’s Java OpenGL API to add + support for drawing and manipulating 2D and 3D graphics in your app. +
+ ++ If you are developing an app that requires C or C++ code, you can use the + Android NDK to access some of these native platform libraries directly from + your native code. +
+ ++ The entire feature-set of the Android OS is available to you through APIs + written in the Java language. These APIs form the building blocks you need to + create Android apps by simplifying the reuse of core, modular system + components and services, which include the following: +
+ ++ Developers have full access to the same framework APIs that Android system apps use. +
+ ++ Android comes with a set of core apps for email, SMS messaging, calendars, + internet browsing, contacts, and more. Apps included with the platform have + no special status among the apps the user chooses to install. So a + third-party app can become the user's default web browser, SMS messenger, or + even the default keyboard (some exceptions apply, such as the system's + Settings app). +
+ ++ The system apps function both as apps for users and to provide key + capabilities that developers can access from their own app. For example, if + your app would like to deliver an SMS message, you don't need to build that + functionality yourself—you can instead invoke whichever SMS app is already + installed to deliver a message to the recipient you specify. +
\ No newline at end of file diff --git a/docs/html/preview/j8-jack.jd b/docs/html/guide/platform/j8-jack.jd similarity index 63% rename from docs/html/preview/j8-jack.jd rename to docs/html/guide/platform/j8-jack.jd index 4ea016da6d004..9b19426200e63 100644 --- a/docs/html/preview/j8-jack.jd +++ b/docs/html/guide/platform/j8-jack.jd @@ -1,41 +1,63 @@ -page.title=Java 8 Language Features +page.title=Use Java 8 Language Features page.keywords="android N", "Java 8", "Jack" @jd:bodyAndroid N introduces support for Java 8 language features - that you can use when developing apps that target Android N. - This page describes the new language features supported in the Android N - Preview, how to properly set up your project to use them, and any known - issues you may encounter. +
+ Android supports all Java 7 language features and a subset of Java 8 language + features that vary by platform version. This page describes the new language + features you can use, how to properly configure your project to use them, and + any known issues you may encounter.
-To start using these features, you need to download and set up Android -Studio 2.1 and the Android N Preview SDK, which includes the required -Jack toolchain and updated Android Plugin for Gradle. If you haven't yet -installed the Android N Preview SDK, see Set Up to Develop for Android N.
- - -- Note: Using the new Java 8 language features is not a - requirement for developing apps that target the Android N platform. If you - don't want to write code with Java 8 language features, you can keep your - project's source and target compatibility values set to Java 7, but you still - must compile with JDK 8 to build against the Android N platform. + Note: When developing apps for Android, using Java 8 + language features is optional. You can keep your project's source and target + compatibility values set to Java 7, but you still need to compile using JDK + 8. +
+ ++ Support for Java 8 language features requires a new compiler called Jack. Jack is supported + only on Android Studio 2.1 and higher. So if you want to use Java 8 language + features, you need to use Android Studio 2.1 to build your app. +
+ ++ If you already have Android Studio installed, make sure you update to the + latest version by clicking Help > Check for Update (on + Mac, Android Studio > Check for Updates). If you don't + already have the IDE installed on your workstation, download Android Studio here.
- Android does not currently support all Java 8 language features. However, the - following features are now available when developing apps targeting the - Android N Preview: + Android does not support all Java 8 language features. However, the + following features are available when developing apps targeting + Android 7.0 (API level 24):
- Additionally, the following Java 8 language feature APIs are now available: + Additionally, the following Java 8 language APIs are also available:
In order to use the new Java 8 language features, you need to also use the - new Jack toolchain. This new - Android toolchain compiles Java language source into Android-readable dex - bytecode, has its own {@code .jack} library format, and provides most toolchain - features as part of a single tool: repackaging, shrinking, obfuscation and - multidex. + Jack toolchain. + This new Android toolchain compiles Java language sources into + Android-readable DEX bytecode, has its own {@code .jack} library format, and + provides most toolchain features as part of a single tool: repackaging, + shrinking, obfuscation and multidex.
Here is a comparison of the two toolchains used to build Android DEX files:
- To enable the Java 8 language features and Jack for your project, enter the + To enable Java 8 language features and Jack for your project, enter the following in your module-level {@code build.gradle} file:
@@ -195,7 +216,7 @@ android {@@ -217,5 +238,5 @@ examples of these tools are:
If you find other problems while using Jack, If you find other issues while using Jack, please file a bug.
\ No newline at end of file diff --git a/docs/html/guide/practices/verifying-apps-art.jd b/docs/html/guide/practices/verifying-apps-art.jd index 217c65c9fcd2b..2da7c0e86124e 100644 --- a/docs/html/guide/practices/verifying-apps-art.jd +++ b/docs/html/guide/practices/verifying-apps-art.jd @@ -2,60 +2,82 @@ page.title=Verifying App Behavior on the Android Runtime (ART) @jd:bodyWith Android 4.4, we are beginning to roll out a new Android runtime, -ART. This runtime offers a number of new features that improve -performance and smoothness of the Android platform and apps. (You can find more -information about ART's new features in Introducing -ART.)
++ The Android runtime (ART) is the default runtime for devices running Android + 5.0 (API level 21) and higher. This runtime offers a number of features + that improve performance and smoothness of the Android platform and apps. + You can find more information about ART's new features in Introducing + ART. +
-Currently, ART is available on a number of Android 4.4 devices, such as the -Nexus 4, Nexus 5, Nexus 7, and Google Play edition devices. -At this time, all devices still use Dalvik as the default runtime. We encourage -you to test your apps for ART compatibility and to take advantage of ART's new -features. However, for the time being, you should also take care to maintain -compatibility with Dalvik.
- -This document lets you know about things to watch for when migrating an -existing app to be compatible with ART. Most apps should just work when -running with ART. However, some techniques that work on Dalvik do not work on -ART. This document discusses some of these issues.
++ However, some techniques that work on Dalvik do not work on ART. This + document lets you know about things to watch for when migrating an existing + app to be compatible with ART. Most apps should just work when running with + ART. +
ART's JNI throws errors in a number of cases where Dalvik didn’t. (Once +
ART's JNI throws errors in a number of cases where Dalvik doesn’t. (Once again, you can catch many such cases by testing with CheckJNI.)
For example, if RegisterNatives is called with a method that
diff --git a/docs/html/preview/_book.yaml b/docs/html/preview/_book.yaml
index ad67249685544..a3458ddeaf6c1 100644
--- a/docs/html/preview/_book.yaml
+++ b/docs/html/preview/_book.yaml
@@ -262,27 +262,6 @@ toc:
value: ICU4J Android 框架 API
- name: zh-tw-lang
value: ICU4J Android 架構 API
- - title: Java 8 Language Features
- path: /preview/j8-jack.html
- path_attributes:
- - name: es-lang
- value: Funciones del lenguaje Java 8
- - name: in-lang
- value: Fitur Bahasa Java 8
- - name: ja-lang
- value: Java 8 の機能
- - name: ko-lang
- value: Java 8 언어 기능
- - name: pt-br-lang
- value: Recursos de linguagem do Java 8
- - name: ru-lang
- value: Возможности языка Java 8
- - name: vi-lang
- value: Tính năng của Ngôn ngữ Java 8
- - name: zh-cn-lang
- value: Java 8 语言功能
- - name: zh-tw-lang
- value: Java 8 語言功能
- title: Android for Work Updates
path: /preview/features/afw.html
- title: Scoped Directory Access