安卓第一天

来源:互联网 发布:cv 怎么写 知乎 编辑:程序博客网 时间:2024/06/10 22:23

翻译:

The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.

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.

With a single download, the ADT Bundle includes everything you need to begin developing apps:

  • Eclipse + ADT plugin
  • Android SDK Tools
  • Android Platform-tools
  • The latest Android platform
  • The latest Android system image for the emulator

Android SDK为安卓提供了你的API和开发工具,建立测试和调试应用程序

如果你是一个新的Android开发者,我们推荐您下载ADT束快速开发应用程序的开始。它包括必要的Android SDK的组件一个版本内置ADT Eclipse IDE(Android开发工具)简化你的Android应用程序的开发

与一个单一的下载ADT包括一切你需要开始开发应用程序

Eclipse + ADT插件

Android SDK工具

Android平台的工具

最新的Android平台

最新的Android系统镜像的模拟器

 

  1. Click New in the toolbar.
  2. 点击此图标新建
  3. In the window that appears, open the Android folder, selectAndroid Application Project, and clickNext.

    Figure 1. The New Android App Project wizard in Eclipse.

  4. 在出现的窗口中,打开Android文件夹,选择Android应用程序项目,然后单击“下一步”。图1。的Android应用程序向导在Eclipse项目
  5. 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就是面向用户的,在这个工程里,使用我的第一个应用。

    • Project Name is the name of your project directory and the name visible in Eclipse.
    • 工程名就是你工程目录的名字和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.
    • 包的名称是为你的应用程序包的命名空间(以下为Java编程语言在包装相同的规则)。你的包的名称必须在安装Android系统上所有的软件包是独一无二的。出于这个原因,通常最好是如果你使用一个名称,开始与反向域名您的组织或出版商的实体。在这个项目中,您可以使用一些像“COM例如myfirstapp但是无法发布您的应用程序使用谷歌COM例如命名空间
    • 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.
    • 低要求的最低版本的Android SDK,你的应用程序支持,采用先水平显示。为了支持尽可能多的设备,你应该设置为最低的版本,允许你的应用程序提供其核心功能设置。如果你的应用程序的任何特征只有在最新版本的Android是可能的,这并不是该软件的核心功能的关键,你可以启用该功能的版本,支持运行时(如支持不同平台的版本)。离开这个设置为这个项目的默认值
    • Target SDK indicates the highest version of Android (also using theAPI level) with which you have tested with your application.
    • Target SDK意味着你将测试的应用程序的最高版本
    • 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.

    •  

      新的版本如果是可用的,你应该在新的版本上测试和更新这个值去匹配最新的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.
    • 编译是平台的版本,以备你编译你的应用程序。默认情况下,这将在你的Android SDK的最新版本。(这应该是Android 4.1或更高;如果你没有这样的一个版本,您必须安装一个使用SDK经理)。你仍然可以建立您的应用程序支持的旧版本设置生成目标的最新版本允许您启用新的功能和优化的最新设备,一个伟大的用户体验你的应用
    • Theme specifies the Android UI style to apply for your app. You can leave this alone.

      Click Next.

    • 主题是安卓UI来迎合你的app,你可以自己设置,点击下一步

       6 . On the next screen to configure the project, leave the default selections and clickNext.

       在配置项目的下一个屏幕默认的选择clicknext

       7.    The next screen can help you create a launcher icon for your app.

       下一个屏幕能够帮助你为你的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 meetsthe  specifications defined in theIconography design guide.

     您可以自定义在几个方面一个图标和工具生成的所有的屏幕密度图标。在你发布你的应用程序你应该确保你的图标规格定义theiconography设计指南

       8.   Now you can select an activity template from which to begin building your app .

             For this project, select BlankActivity and clickNext.

             现在你可以选择为你的应用程序建一个活动模版,在这个工程中,选择空白的或者是点击下一步

       9.  Leave all the details for the activity in their default state and clickFinish.

           使所以的activity成为缺省状态或者是点击完成。

 

 面试题:Java虚拟机和安卓虚拟机的区别:

Dalvik 基于寄存器,而 JVM 基于栈。基于寄存器的虚拟机对于更大的程序来说,在它们编译的时候,花费的时间更短。Dalvik 和Java 运行环境的区别1:Dalvik主要是完成对象生命周期管理,堆栈管理,线程管理,安全和异常管理,以及垃圾回收等等重要功能。2:Dalvik负责进程隔离和线程管理,每一个Android应用在底层都会对应一个独立的Dalvik虚拟机实例,其代码在虚拟机的解释下得以执行。3:不同于Java虚拟机运行java字节码,Dalvik虚拟机运行的是其专有的文件格式Dex4:dex文件格式可以减少整体文件尺寸,提高I/o操作的类查找速度。5:odex是为了在运行过程中进一步提高性能,对dex文件的进一步优化。6:所有的Android应用的线程都对应一个Linux线程,虚拟机因而可以更多的依赖操作系统的线程调度和管理机制7:有一个特殊的虚拟机进程Zygote,他是虚拟机实例的孵化器。它在系统启动的时候就会产生,它会完成虚拟机的初始化,库的加载,预制类库和初始化的操作。如果系统需要一个新的虚拟机实例,它会迅速复制自身,以最快的数据提供给系统。对于一些只读的系统库,所有虚拟机实例都和Zygote共享一块内存区域。

 

 

 

 

 

 

 

 

0 0
原创粉丝点击