2024年3月29日发(作者:翁雪莲)
一、Introduction(入门)
0、Introduction to Android(引进到Android)
Android provides a rich application framework that
allows you to build innovative apps and games for
mobile devices in a Java language environment.
The documents listed in the left navigation provide
details about how to build apps using Android's
various APIs.
Android提供了丰富的应用程序框架,它允许您在
Java语言环境中构建移动设备的创新应用程序和
游戏。在左侧导航中列出的文档提供了有关如何使
用Android的各种API来构建应用程序的详细信
息。
To learn how apps work, start
withApp Fundamentals.
To begin coding right away,
readBuilding Your First App
要了解如何开发应用,从 应用基础
开始。
如何开始一个正确的编码,请参照
建立你的第一个应用程序。
Apps provide multiple entry points Apps adapt to different devices
应用程序提供多个入口点
Android apps are built as a combination of
distinct components that can be invoked
individually. For instance, an
individual activity provides a single screen for
a user interface, and a service independently
performs work in the background.
Android应用程序被构建为能够单独地被调用
不同的部件的组合。例如,一个单独的Activity
提供了一个单个屏幕上的用户界面,和一个
Service独立地在后台中执行工作。
应用程序适应不同的设备
Android provides an adaptive app
framework that allows you to provide
unique resources for different device
configurations. For example, you can
create different XML layout files for
different screen sizes and the system
determines which layout to apply based
on the current device's screen size.
Android提供了一个自适应的应用程序
框架,它允许您为不同的设备配置提供不
同的资源。例如,您可以为不同的屏幕尺
寸创建不同的XML布局文件并且系统决
定了基于当前屏幕尺寸使用哪些布局。
You can query the availability of device
features at runtime if any app features
require specific hardware such as a
camera. If necessary, you can also
declare features your app requires so
app markets such as Google Play Store
do not allow installation on devices that
do not support that feature.
From one component you can start another
component using an intent. You can even
start a component in a different app, such an
activity in a maps app to show an address.
This model provides multiple entry points for
a single app and allows any app to behave as
a user's "default" for an action that other apps
may invoke.
从一个组件就可以使用一个Intent启动另一个
组件。你甚至可以启动不同应用程序中的一个
组件,比如启动一个地图应用中的Activity来
显示地址。该模型为一个单一的应用程序提供
了多个入口点,并允许任何应用程序的行为作
为用户的“默认”,用于其他应用程序调用的
Action
Learn more:
你可以在运行时查询设备功能的可用性,
如果任何应用程序的功能需要特定的硬
件如照相机。如果需要,你也可以定义你
的应用程序需要的特性,,如Google Play
商店不允许不支持该特性的设备安装。
Learn more:
Device Compatibility
Resources Overview
User Interface Overview
了解更多:
App Fundamentals
Intents and Intent Filters
Activities
了解更多:
应用基础
意图和意图过滤器
Activities
设备兼容性
资源概述
用户界面概述
1、Application Fundamentals(应用程序基础)
Android apps are written in the Java programming
language. The Android SDK tools compile your
code—along with any data and resource files—
into an APK: an Android package, which is an
archive file with an
.apk
suffix. One APK file
contains all the contents of an Android app and is
the file that Android-powered devices use to install
the app.
Android应用程序是用Java写的。Android SDK工
具编译你的代码以及任何数据和资源文件为APK:
一个Android
包
,这是一个以.apk为后缀的存档文
件。一个APK文件包含了一个Android应用程序
的所有内容,是Android平台的设备应用程序的安
装文件。
Once installed on a device, each Android app lives
in its own security sandbox:
一旦安装在设备上,每个Android应用程序存在于
它自己的安全沙箱中:
IN THIS DOCUMENT
App Components
Activating components
The Manifest File
Declaring components
Declaring component
capabilities
Declaring app requirements
App Resources
在本文档中
应用程序组件
激活组件
清单文件
声明组件
声明组件的能力
2024年3月29日发(作者:翁雪莲)
一、Introduction(入门)
0、Introduction to Android(引进到Android)
Android provides a rich application framework that
allows you to build innovative apps and games for
mobile devices in a Java language environment.
The documents listed in the left navigation provide
details about how to build apps using Android's
various APIs.
Android提供了丰富的应用程序框架,它允许您在
Java语言环境中构建移动设备的创新应用程序和
游戏。在左侧导航中列出的文档提供了有关如何使
用Android的各种API来构建应用程序的详细信
息。
To learn how apps work, start
withApp Fundamentals.
To begin coding right away,
readBuilding Your First App
要了解如何开发应用,从 应用基础
开始。
如何开始一个正确的编码,请参照
建立你的第一个应用程序。
Apps provide multiple entry points Apps adapt to different devices
应用程序提供多个入口点
Android apps are built as a combination of
distinct components that can be invoked
individually. For instance, an
individual activity provides a single screen for
a user interface, and a service independently
performs work in the background.
Android应用程序被构建为能够单独地被调用
不同的部件的组合。例如,一个单独的Activity
提供了一个单个屏幕上的用户界面,和一个
Service独立地在后台中执行工作。
应用程序适应不同的设备
Android provides an adaptive app
framework that allows you to provide
unique resources for different device
configurations. For example, you can
create different XML layout files for
different screen sizes and the system
determines which layout to apply based
on the current device's screen size.
Android提供了一个自适应的应用程序
框架,它允许您为不同的设备配置提供不
同的资源。例如,您可以为不同的屏幕尺
寸创建不同的XML布局文件并且系统决
定了基于当前屏幕尺寸使用哪些布局。
You can query the availability of device
features at runtime if any app features
require specific hardware such as a
camera. If necessary, you can also
declare features your app requires so
app markets such as Google Play Store
do not allow installation on devices that
do not support that feature.
From one component you can start another
component using an intent. You can even
start a component in a different app, such an
activity in a maps app to show an address.
This model provides multiple entry points for
a single app and allows any app to behave as
a user's "default" for an action that other apps
may invoke.
从一个组件就可以使用一个Intent启动另一个
组件。你甚至可以启动不同应用程序中的一个
组件,比如启动一个地图应用中的Activity来
显示地址。该模型为一个单一的应用程序提供
了多个入口点,并允许任何应用程序的行为作
为用户的“默认”,用于其他应用程序调用的
Action
Learn more:
你可以在运行时查询设备功能的可用性,
如果任何应用程序的功能需要特定的硬
件如照相机。如果需要,你也可以定义你
的应用程序需要的特性,,如Google Play
商店不允许不支持该特性的设备安装。
Learn more:
Device Compatibility
Resources Overview
User Interface Overview
了解更多:
App Fundamentals
Intents and Intent Filters
Activities
了解更多:
应用基础
意图和意图过滤器
Activities
设备兼容性
资源概述
用户界面概述
1、Application Fundamentals(应用程序基础)
Android apps are written in the Java programming
language. The Android SDK tools compile your
code—along with any data and resource files—
into an APK: an Android package, which is an
archive file with an
.apk
suffix. One APK file
contains all the contents of an Android app and is
the file that Android-powered devices use to install
the app.
Android应用程序是用Java写的。Android SDK工
具编译你的代码以及任何数据和资源文件为APK:
一个Android
包
,这是一个以.apk为后缀的存档文
件。一个APK文件包含了一个Android应用程序
的所有内容,是Android平台的设备应用程序的安
装文件。
Once installed on a device, each Android app lives
in its own security sandbox:
一旦安装在设备上,每个Android应用程序存在于
它自己的安全沙箱中:
IN THIS DOCUMENT
App Components
Activating components
The Manifest File
Declaring components
Declaring component
capabilities
Declaring app requirements
App Resources
在本文档中
应用程序组件
激活组件
清单文件
声明组件
声明组件的能力