This is a guide for creating a new Android Eclipse project from source code on GitHub. It is tailored to my independent study project for the benefit of my partners, but it could be easily adapted to any Android project.
Note: This guide was created for Windows 7 64-bit. Other versions of Windows should be similar.
1. Download and install Java SE Development Kit for Windows x86
Note: I highly recommend NOT installing to the default C:\Program Files (x86)\Java\ folder. The Program Files folder has very restrictive permissions which may cause file writing/copying errors in the future. I chose to install to C:\Java\.
2. Download and install Android SDK for Windows
Note: Again I recommend NOT installing to the default folder. I chose to install to C:\Android\.
3. Run the Android SDK Manager and install the groups: Tools, Android 4.1 (API 16), and Android 2.2 (API 8).
4. Download either Eclipse Classic for Windows 32-bit or Eclipse for Java Developers for Windows 32-bit
5. Extract the downloaded eclipse\ folder into your Java\jdk*\ folder
6. Download and install GitHub for Windows
7. Run Eclipse, and choose your GitHub folder as your workspace
8. Install Eclipse ADT Plugin
Note: If you get an error after restarting Eclipse about not being able to find the Android SDK, just click the Preferences button and point to your Android\android-sdk\ folder.
9. Create a new Android project, and then close Eclipse afterwards
Name the project Task Butler, and name the package edu.worcester.cs499summer2012. The target SDK should be API 16 and the minimum required SDK should be API 8.
10. Clone the CS499Summer2012 repo to your local GitHub folder
11. Move the local repo files into your Task Butler folder
- In your GitHub\Task Butler\ folder, delete everything EXCEPT .settings\, .project, and .classpath
- Move everything from GitHub\CS499Summer2012\ into GitHub\Task Butler\
- Note: Make sure “Show hidden files, folders, and drives” is enabled in Windows Explorer’s Folder options so you can see the hidden .git folder
- Delete the now-empty \GitHub\CS499Summer2012\ folder
12. Reopen Eclipse, and the project should now have all of its files (and lots of errors!)
13. Download ActionBarSherlock and extract it somewhere
I chose C:\Android\
14. In Eclipse, import the library\ folder inside the ActionBarSherlock folder as a new project
15. Modify the library’s Android properties and Java Compiler properties to get rid of errors
Make sure the build target is set to 4.1 and the “Is library” checkbox is checked.
Make sure the Compiler compliance level is set to 1.6.
16. Modify Task Butler’s Android properties to include the new library
Make sure the build target is 4.1 and add ActionBarSherlock to Library (if there is one listed already with a question mark, remove it).
17. If necessary, clean the project and it should rebuild itself with no errors.
The project is now ready to be worked on!
From the blog Code Your Enthusiasm » WSU CS by Jon and used with permission of the author. All other rights reserved by the author.