Create a Project with Eclipse
- Click New in the toolbar.
- In the window that appears, open the Android folder, select Android Application Project, and click Next.
- 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.
- On the next screen to configure the project, leave the default selections and click Next.
- 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.
- 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.
Your Android project is now a basic "Hello World" app that contains some default files. To run the app, continue to the next lesson.
1.在工具栏中点击新建
2.在出现的窗口中,打开安卓文件夹,选择安卓应用程序项目,然后单击下一步。
3.在出现的表中填入:
应用程序名称是应用显示给用户时的名称,这个项目中使用“My First App”这个名称。
项目名称是你的项目目录和在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风格申请您的应用程序。你可以不理会这一点。
单击下一步。
4.在下一个屏幕,用于配置项目,保留默认选项,然后单击下一步。
5. 下一个屏幕可以帮助您为您的应用程序的起动器图标。您可以通过多种方式自定义的图标和工具生成所有的屏幕密度的图标。在您发布您的应用程序,你应该确保你的图标在开会的影像学设计指南中定义的规范。
单击下一步。
6. 现在,您可以选择要开始建立你的应用程序的活动模板。
对于这个项目,选择BlankActivity,然后单击下一步。
7. 离开所有的细节在其默认状态的活动,并单击Finish。
你的Android项目现在是一个基本的“Hello World”应用程序,它包含了一些默认的文件。为了运行应用程序,继续下一课。