Set up environment
Table of Contents
- Eclipse Classic
- JRE (Java Runtime Environment)
- JDK (Java Development Kit)
Android SDK (Software Development Kit)
- Install all API (Application Programming Interface) levels (even Google API's)
- Create a new AVD (Android Virtual Device), that should be Google API 2.2 - level 8 - 512 MB memory
- Git client; MsysGit (if you use Windows) or git extensions.
- Configure Git by following this guide (if you use Windows)
- A few pointers:
- Toward the end a randomart image might not show up. It is okay if it does not as you do not need it right now
- You will also get a key fingerprint (MD5 fingerprint) at this step. Save that for now (you need it later when you want to obtain your own Google Map)
- When you are at the step of getting a SSH key make sure you get the right one. In your folder there should be two id_rsa files; one id_rsa and one id_rsa.pub (it is the .pub you want). This might be disguised as a Microsoft Office Publisher document, so do not be fooled by that...
- Install and configure Android ADT (Android Development Tools)
- Install EGit in Eclipse (Help > Install New Software... > "Available Software Sites" > Search for 'egit')
- Change SSH directory in Eclipse (Window > Preferences > Search for 'SSH2' and click on that option > Your SSH2 home folder should be something like
C:\Users\[your name]\.ssh) <--- notice that there is a dot before 'ssh'. This one is important!
- Set up your personal Google Map by doing the following:
- Go to this site. Check the checkbox and fill in your MD5 fingerprint (you should have got one when you configured Git). You will now obtain an API (Application Programming Interface) key
- Go back to Eclipse and go to LUSitesActivity > res > layout > main.xml and find the commentary close to the end of the code. Fill in your API key (development key) in this commentary. After that, find the attribute that says
android:apiKeyin main.xml and paste your API key here as well (note: do not commit this file at any time. This is your own personal key for getting the Google Map to work in the emulator. If you commit this the key will be the same for all others who work on this project but the map will only work for you)
- Create an account on GitHub
- Become a LUSites contributor (by contacting the admin)
- Add your public SSH key on GitHub (if you have not done this before during the configuring of Git)
- Checkout from GitHub in Eclipse (File > Import... > Git > Projects from Git > Clone... > URI:
git+ssh://email@example.com/mirontoli/Lusites.gitand click Next > Enter your passphrase, from when you configured Git > Select Master and click Next > Directory:
C:\Users\[your name]\Lusites> Finish)
- Use the New projects wizard to import the project, because you should not copy it to your workspace! (see Import LUSites to Eclipse on how to do this)
For a crash course, see this link.
The basic steps are
- Add - whenever you add a new element (class, file, image...) there will be a small question mark next to this element (instead of the regular yellow cylinder). To fix this right-click on the element and select Team > Add
- Commit - Whenever you changed something in an element a > sign will be visible next to the element (this means that you have not committed the changes yet). To fix this right-click on the element and select Team > Commit... > Fill out a commit message i.e. what you have changed and check the checkboxes on what you want to commit > Push the commit button
- Push to Upsteam - First things first, here you need to have the Git Repositories tab open. To get this tab, go to: Window > Show View > Other... > Git > Git Repositories. Now, in this tab you can push your repository to this page. To do this, you need to right-click on your repository (LUSites) and click Push to Upsteam. This will then publish the changes you have committed before (all of them, at the same time). Others will then have the pleasure of seeing, and downloading, the hard work you have put down on improving this app!
- Pull/Fetch from Upstream - Sometimes you cannot use the option Push to Upsteam. This is because someone else has been modifying the elements which you have been working on and you need to download their updated versions first. You do this by Pulling or Fetching, which is done by right-clicking on your repository (LUSites) and click Pull/Fetch from Upstream. You will then get the latest version of the app and you may then publish your changes.
git remote add origin firstname.lastname@example.org:mirontoli/Lusites.git
git pull origin master
Create a fingerprint first.
"C:\Program Files\Java\jdk1.6.0_24\bin\keytool.exe" -list -alias androiddebugkey -keystore C:\Users\MyUserAccount\.android\debug.keystore -storepass android -keypass android > C:\Users\MyUserAccount\Desktop\fingerprint.txt