您的位置:首页 > 其它

如何创建一个安卓项目

2014-05-19 22:33 323 查看

Creating an Android Project

如何创建一个安卓项目

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.

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(软件开发工具包)执行命令语句来创建一个新的安卓项目。

Note: You should already have the Android SDK installed, and if you're using Eclipse, you should also have theADT
plugin installed (version 22.6.2 or higher). If you don't have these, follow the guide toInstalling the Android SDK before you start this lesson.
注意:要保证安装安卓软件开发工具包,如果你正在用Eclipse,也要安装ADT插件(22.6.2版本及以上)。如果没有这些配置,应先安装安卓软件开发工具包,在进行线面的创建工作。

Create a Project with Eclipse

如何创建一个Eclipse项目

Click New

in the toolbar. 点击工具栏上的


In the window that appears, open the Android folder, selectAndroid Application Project, and click
Next. 在出现的窗体中,打开安卓文件夹,选择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."

应用程序名字: 给程序的应用者看的,eg:My First App

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中程序语言的包的命名规则一样)。包名在安卓应用系统中必需唯一,因此,最好以所工作机构的域名反转或者出版实体的名字开始包名。比如:com.example.myfirstapp,不能用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 in
Supporting Different Platform Versions). Leave this set to the
default value for this project.

Minimum Required SDK表明所用的API等级为最低版本的软件开发工具。为了尽可能支持更多的设备,可以设置所达到的最低版本,使应用提供核心的操作可以被最大版本范围的使用。如果应用的突出操作能够在更新的安卓版本上使用,并且也没什么错误,仅当应用程序在该版本上能够运行也是无可厚非的。

Target SDK indicates the highest version of Android (also using theAPI
level) with which you have tested with your application.

目标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.

当有新的安卓版本出现时,应该在该版本上测试应用并且做出更新属性值,以适应最新的应用编程软件接口等级充分利用新的平台特性。

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.

编译:能够编译应用程序的编译平台版本,默认情况下,应该是最新的安卓软件开发工具包(包括4.1,以及更高版本,如果没有达到最新版本,必需下载安装)。也可以使创建的应用可以再更老的版本上运行,但是在最新版本上创建目标将使应用程序功能突出,有优化应用程序,便利用户操作的功能。

Theme specifies the Android UI style to apply for your app. You can leave this alone.

主题:指定所编应用程序的安卓用户峰峰,你也可以设置为none

Click Next. 击下一步

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 clickNext.

选择BlankActivity,点击下一步

Leave all the details for the activity in their default state and clickFinish.
不做任何设置,点击完成。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: