如何将 Android 示例导入 Eclipse IDE

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6307399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:25:42  来源:igfitidea点击:

How to import Android samples into an Eclipse IDE

androideclipse

提问by Jason

android-sdk-windows\samples contains various samples. Is there a mechanism to eclipsify all samples as android eclipse projects, so that it can be viewed in an Eclipse environment.

android-sdk-windows\samples 包含各种示例。是否有一种机制可以将所有示例都作为 android eclipse 项目进行 eclipsify,以便可以在 Eclipse 环境中查看。

回答by Trevor

You can use File-> New-> Android Projectand select 'Create project from existing source' to import an existing project. However, sometimes it's headbangingly annoying to get it to work right.

您可以使用File-> New->Android Project并选择“从现有源创建项目”以导入现有项目。然而,有时让它正常工作令人头疼。

In the New Android Project dialogue there's also a radio button option 'Create project from existing sample', which, coming to think of it, is probably what you want to use in this case.

在 New Android Project 对话框中,还有一个单选按钮选项“从现有示例创建项目”,仔细想想,在这种情况下可能是您想要使用的。

回答by oabarca

To import a sample project go to: File >> New >> Other >> Android >> Android Sample Project

要导入示例项目,请转到:文件 >> 新建 >> 其他 >> Android >> Android 示例项目

When you use the Android SDK Manager to install the samples, Eclipse will recognize the path and will provide you with a list of Sample Projects installed in your computer.

当您使用 Android SDK 管理器安装示例时,Eclipse 将识别路径并为您提供安装在您计算机中的示例项目列表。

回答by Vinayak

File->New -> Others->Android->Android sample project ->Select api level ->select sample project ->open

文件->新建->其他->Android->Android示例项目->选择api级别->选择示例项目->打开

回答by adityadafre

In Eclipse Juno you can go to File - New Project - Android - Android Sample Project. You need to select a build target and then just select from a bunch of sample projects which you should have downloaded using Eclipse-Help- Install Software etc. All the sample projects show up with the Droid icon. Hope this helps.

在 Eclipse Juno 中,您可以转到 File - New Project - Android - Android Sample Project。您需要选择一个构建目标,然后从一堆您应该使用 Eclipse-Help-Install Software 等下载的示例项目中进行选择。所有示例项目都显示有 Droid 图标。希望这可以帮助。

回答by wliao

Assuming eclipse is setup with the Android ADT, you should be able to add a new Android project and point it to the existing folder.

假设 eclipse 是使用 Android ADT 设置的,您应该能够添加一个新的 Android 项目并将其指向现有文件夹。

回答by Scott C Wilson

You can't do them all at once - you have to do them one at a time. The answer from @Trev16v provides the steps; repeat for each sample of interest.

你不能一次做所有的事情——你必须一次做一个。@Trev16v 的回答提供了步骤;对每个感兴趣的样本重复。

回答by Rajesh Rajaram

Try this in ADT.

在 ADT 中试试这个。

File --> New --> Project.. --> Android Sample Project(Inside Android) --> (Select your build target) and finish. If you installed the sample projects, it will show the list of projects. Select and open.

文件 --> 新建 --> 项目.. --> Android 示例项目(Android 内部) -->(选择您的构建目标)并完成。如果您安装了示例项目,它将显示项目列表。选择并打开。