Jason
Jason

Reputation: 12789

How to import Android samples into an Eclipse IDE

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.

Upvotes: 17

Views: 18702

Answers (7)

Vinayakkumar
Vinayakkumar

Reputation: 6520

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

Upvotes: 3

dev4life
dev4life

Reputation: 11394

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

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.

Upvotes: 15

Rajesh Rajaram
Rajesh Rajaram

Reputation: 3277

Try this in 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.

Upvotes: 0

adityadafre
adityadafre

Reputation: 21

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.

Upvotes: 2

Scott C Wilson
Scott C Wilson

Reputation: 20036

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.

Upvotes: 1

wliao
wliao

Reputation: 159

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.

Upvotes: 1

Trevor
Trevor

Reputation: 10993

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

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.

Upvotes: 19

Related Questions