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.
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\.
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).
5. Extract the downloaded eclipse\ folder into your Java\jdk*\ folder
7. Run Eclipse, and choose your GitHub folder as your workspace
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.
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!)
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!