用Eclipse创建安卓项目

来源:互联网 发布:淘宝搜索有问题 编辑:程序博客网 时间:2024/06/08 16:34

原文:

Create a Project with Eclipse


  1. Click New  in the toolbar.
  2. In the window that appears, open the Android folder, select Android Application Project, and click Next.

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

  3. Fill in the form that appears:
    • Application Name is the app name that appears to users. For this project, use "My First App."

    • Project Name is the name of your project directory and the name visible in 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.
    • Minimum Required SDK is the lowest version of Android that your app supports, indicated using the API 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 in Supporting Different Platform Versions). Leave this set to the default value for this project.
    • Target SDK indicates the highest version of Android (also using the API 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.

    • 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.
    • Theme specifies the Android UI style to apply for your app. You can leave this alone.

    Click Next.

  4. On the next screen to configure the project, leave the default selections and click Next.
  5. 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 the Iconography design guide.

    Click Next.

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

    For this project, select BlankActivity and click Next.

  7. Leave all the details for the activity in their default state and click Finish.

Your Android project is now a basic "Hello World" app that contains some default files. 


翻译:在工具栏上单击新建。在出现的窗口中,打开Android的文件夹,选择Android的应用程序项目,然后单击下一步。在出现的表单填写:应用程序名称是出现给用户的应用程序名称。对于这个项目,使用“我的第一个应用程序。 ”项目名称就是你的项目目录的名称,名称在Eclipse中可见。包名称是包的命名空间为您的应用程序(遵循相同的规则,在Java编程语言包) 。你的包名称必须在安装了Android系统上的所有软件包唯一的。出于这个原因,它通常最好的,如果您使用的开始与您的组织或出版者实体的反向域名名称。对于这个项目,你可以使用类似“ com.example.myfirstapp 。 ”但是,你不能在谷歌播放使用为“com.example ”命名空间发布你的应用程序。最低要求SDK是Android的最低版本,您的应用程序的支持,使用API​​级别表示。为了支持尽可能多的设备越好,你应该将其设置为可用,可以让您的应用程序,以提供其核心功能集的最低版本。如果您的应用程序的任何功能可能只在较新版本的Android ,它不是以应用程序的核心功能集的关键,你可以在支持它的版本只运行时(如在支持不同的平台版本讨论)启用该功能。将它设置为默认值,为这个项目。目标指示的SDK最高版本的Android (也使用API​​级别),您已与您的应用程序进行测试的。由于Android的新版本可用,您应该测试应用程序的新版本,并更新此值,以便利用新的平台功能利用最新的API级别相匹配。编译为平台版本针对您将编译您的应用程序。默认情况下,此选项设置为可用的Android的最新版本,在你的SDK 。 (这应该是Android的4.1或更高版本,如果你没有这样的版本,您必须使用SDK管理器安装一个) 。你还可以建立自己的应用程序来支持旧版本,但构建目标设定到最新版本允许您启用新功能和优化您的应用程序的最新的设备出色的用户体验。主题指定了Android的UI风格申请您的应用程序。你可以不理会这一点。单击下一步。在下一个屏幕,用于配置项目,保留默认选项,然后单击下一步。下一个屏幕可以帮助你创建你的应用程序的起动器图标。您可以通过多种方式自定义的图标和工具生成所有的屏幕密度的图标。在您发布您的应用程序,你应该确保你的图标在开会的影像学设计指南中定义的规范。单击下一步。现在,您可以选择要开始建立你的应用程序的活动模板。对于这个项目,选择BlankActivity ,然后单击下一步。离开所有的细节在其默认状态的活动,并单击Finish 。你的Android项目现在是一个基本的“Hello World ”应用程序,它包含了一些默认的文件。


0 0
原创粉丝点击