Home ยป Technology | Useful tips

How To Import Sample Android Apps in Eclipse As A Project?

  24. Aug 2011 by Soan

You have downloaded and configured the Android SDK and Eclipse and now ready to explore the sample projects provided by Android. But have you tried importing them into Eclipse?
If yes, then you would have faced an issue which Eclipse reports by saying that it could not find any projects when you specify the project directory for import.

Eclipse is right in flashing this error as Android apps are not eclipse projects. They are Android projects and Eclipse needs help in identifying their internal structure.

So, here are the correct steps to import the sample Android apps in Eclipse as a project:

  1. Set Up SDK Location:
    If you have followed the steps to install and set up Eclipse for Android development, you would have already performed this step.

    Just make sure that the SDK location is specified in
    Eclipse->Window->Preferences->Android

    Set up SDK location in Eclipse

  2. Create a NEW Project:
    Go to
    File->New->Project

    Create a project in Eclipse

  3. Select Android Project:
    A new dialog box opens up, Select 'Android Project' here. Click Next.

    Select Android Project

  4. Select Sample Android App.:
    Select the version of Android that you want to target from the 'Build Target' options. I have selected 'Android 3.2'.
    Choose the option 'Create Project From Existing Sample'. Now, the drop down box against this option will populate according to the 'Build target' that you selected. It will list all the available sample apps projects that you have downloaded.

    Select Sample Android App

    Please note that if there are no sample Apps available in your system for the 'Build target' that you have selected, this drop down box will remain disabled. You should download the sample apps before you can proceed further for your target build.

    Click Finish and your your Android sample app will be added as a project in Eclipse. Here is a screen shot of what it might look like:

    Sample Android App in Eclipse

That's it. You are ready to play with sample Android apps. All the best.

Would you like to share this article?

QR Code for this page Scan this QR code to open this
article in any mobile browser
or share with friends.


For more helpful articles like this, subscribe to our free newsletter or stay connected on social networks:

SUBSCRIBE
Subscribe to AM22 tech in Reader or by Email
Sign up for our updates in Email (Free):

 

Have questions? Write into comments or ask in forum