1、The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.
安卓SDK提供了安卓创建、测试和debug应用的必要的API类和开发工具。
2、If you're a new Android developer, we recommend you download the ADT Bundle to quickly start developing apps. It includes the essential Android SDK components and a version of the Eclipse IDE with built-inADT (Android Developer Tools) to streamline your Android app development.
如果你是一个新的安卓开发者,我们推荐你下载ADT Bundle快速启动开发应用。它包含了必要的安卓SDK组件以及带有ADT开发工具的Eclipse IDE版本来组织你的安卓应用开发。
3、With a single download, the ADT Bundle includes everything you need to begin developing apps:
一个单下载的ADT Bundle包含了你需要开始开发应用的一切:
- Eclipse + ADT plugin Eclipse+ADT插件
- Android SDK Tools 安卓SDK工具
- Android Platform-tools 安卓平台工具
- The latest Android platform 最新的安卓平台
- The latest Android system image for the emulator 最新的安卓系统映像模拟器
4、To get the ADT Bundle or stand-alone SDK Tools, please visit the web site atdeveloper.android.com/sdk/
5、A new Android development environment called Android Studio, based on IntelliJ IDEA, is now available as anearly access preview. For more information, see Getting Started with Android Studio.
一个新的安卓开发环境被称为Android Studio,它基于intelliJ IDEA,现在作为一种早期的访问预览。想要更多的信息,就开始使用Android Studio吧。
6、If you prefer to use an existing version of Eclipse or another IDE, you can instead take a more customized approach to installing the Android SDK. See the following instructions
如果你喜欢使用另一种存在的IDE的Eclipse的版本,你可以采取更加自定义的方法来安装Android SDK。看接下来的说明。
7、An Android project contains all the files that comprise the source code for your Android app. The Android SDK tools make it easy to start a new Android project with a set of default project directories and files.
一个安卓工程包含所有由你安卓应用的源码组成的文件。Android SDK工具让启动一个带有一系列默认工程目录和文件的新的安卓工程变得简单。
8、This lesson shows how to create a new project either using Eclipse (with the ADT plugin) or using the SDK tools from a command line.
这个课告诉我们如何创建一个新的工程以及使用Eclipse工具或者从一个命令行使用SDK工具。
9、 You should already have the Android SDK installed, and if you're using Eclipse, you should also have theADT plugin installed (version 21.0.0 or higher). If you don't have these, follow the guide toInstalling the Android SDK before you start this lesson.
你应该已经安装了Android SDK,如果你正在使用Eclipse,你应该也安装了ADT组件。如果你没有这些,在你开始这个课之前按照指导安装SDK吧。
10、Create a Project with Eclipse创建一个Eclipse工程
- Click New
in the toolbar.在工具栏中点击new。。。
- In the window that appears, open the Android folder, select Android Application Project, and click Next.在window中,打开android文件夹,选择Android Application Project,然后点击Next。
- Fill in the form that appears填写表格:
- Application Name is the app name that appears to users. For this project, use "My First App."
Application Name是针对用户的应用名称。对于这个工程,使用“My First App”。
- Project Name is the name of your project directory and the name visible in Eclipse.Project Name是你项目目录和在Eclipse中可以看见的名字。
- Package Name is the package namespace for your app (following the same rules as packages in the Java programming language). Your package name must be unique across all packages installed on the Android system. For this reason, it's generally best if you use a name that begins with the reverse domain name of your organization or publisher entity. For this project, you can use something like "com.example.myfirstapp." However, you cannot publish your app on Google Play using the "com.example" namespace.Package Name是你应用的包名(在Java程序语言遵循包相同的规则)。您的包名必须是安装在安卓系统包中唯一的。为此,如果你在组织或者发布实体中最好使用逆向域名。对于这个工程,你可以使用比如“com.example.myfirstapp”。但是,你不能在Google Play中使用“com.example”命名空间发布你的应用。
- Minimum Required SDK is the lowest version of Android that your app supports, indicated using theAPI level. To support as many devices as possible, you should set this to the lowest version available that allows your app to provide its core feature set. If any feature of your app is possible only on newer versions of Android and it's not critical to the app's core feature set, you can enable the feature only when running on the versions that support it (as discussed inSupporting Different Platform Versions). Leave this set to the default value for this project. Minimum Required SDK是你的应用支持的最低版本,显示使用API level。为了尽可能的支持设备。你应该设置允许你的应用提供核心特征集的最低版本。如果你应用的任何特征可能只存在于更新的安卓版本中,应用的核心特征集不是关键,你可以当允许支持它的版本运行时使用它。设置它为这个项目的默认值。
- Target SDK indicates the highest version of Android (also using theAPI level) with which you have tested with your application.
As new versions of Android become available, you should test your app on the new version and update this value to match the latest API level in order to take advantage of new platform features.Target SDK表明测试你应用的最高安卓版本。当新的安卓版本出现时,你应该用它测试你的应用并且更新适合你的最新API来充分利用新的平台特征。
- Compile With is the platform version against which you will compile your app. By default, this is set to the latest version of Android available in your SDK. (It should be Android 4.1 or greater; if you don't have such a version available, you must install one using the SDK Manager). You can still build your app to support older versions, but setting the build target to the latest version allows you to enable new features and optimize your app for a great user experience on the latest devices.Compile With是针对会编译你的程序的平台版本。另外,这是在你的SDK可以获得的最新的安卓版本。(它应该是安卓4.1或者更高,如果你没有这样的版本,你必须使用SDK Manager安装一个)。你可以创建你的应用来支持旧的版本,但是设置创建最新版本的目标允许你使用新的特征以及为了获得最新设备的更好的用户体验来优化你的程序。
- Theme specifies the Android UI style to apply for your app. You can leave this alone.Theme指定Android样式来应用你的程序。
- Application Name is the app name that appears to users. For this project, use "My First App."
- On the next screen to configure the project, leave the default selections and clickNext.在下一个屏设定项目,默认选项即可。
- The next screen can help you create a launcher icon for your app.
You can customize an icon in several ways and the tool generates an icon for all screen densities. Before you publish your app, you should be sure your icon meets the specifications defined in theIconography design guide.下一个屏能帮助你创建你应用的运行图标。你可以用各种方式定制一个图标,并用工具生成一个屏幕密度的图标。在你发布程序之前,你应该确定你的图标符合在图解设计指南中定义的规范。
Click Next.
- Now you can select an activity template from which to begin building your app.
For this project, select BlankActivity and click Next.现在你可以选择开始创建你的程序的活动模板。对于这个工程,选择空白活动。
- Leave all the details for the activity in their default state and click Finish.完成他们默认状态活动的所有细节之后点击完成。
11、JVM与DVM的区别:
JVM:编译后的文件格式为.java->.class->.jar;基于栈的架构;.jar中包含很多个.class。
DVM:编译后的文件格式为.java->.class->.dex->.odex;基于寄存器的架构;.app中只有一个.dex。