Ahmed
Ahmed

Reputation: 15039

Importing android source code as a project in eclipse

I have downloaded an android sample called custom view from android refernce from this location

http://developer.android.com/shareables/training/CustomView.zip

It only has the java files and other resources but does not contain any project file for me to import in eclipse as a project.

So when I import existing project into workspace, eclipse does not pick the project in the import dialog.

How can I import it into eclipse ? I have ADT tools installed already,

Thanks, Ahmed

Upvotes: 2

Views: 2806

Answers (3)

Dan
Dan

Reputation: 3331

I encountered the same problem. I did thought that it's missing the AndroidManifest.xml file. I tried to fixed it and place it here. You can download it an try.

Upvotes: 0

Orabîg
Orabîg

Reputation: 11992

Maybe that's because you'll have to make the manifest.xml file.

What I'd suggest, is to create a new Android project, with the same package and Activity's name than in your zip (ie com.example.android.customviews and MainActivity), then copy/paste the files from your zip to the new project directory (thus replacingsrcandres` folders). That way, Eclipse will generate the manifest for you, with correct reference.

This should not take more than 30 seconds...

Upvotes: 1

Priyank Patel
Priyank Patel

Reputation: 12382

Go to Project Explorer and right click -> Import -> Select Android -> Existing Android Code Into Workspace -> browse to folder with your code -> finish

Upvotes: 0

Related Questions