Skip to content
This repository has been archived by the owner on Oct 25, 2018. It is now read-only.

2. Your First Clone

Azri Azmi (Aba) edited this page May 8, 2015 · 11 revisions

Using version control with Android Studio projects is interesting. Sometimes things work and then suddenly things fall apart. Based on experience, most (if not all) auto-generated & auto-modified project files and directories have been added to gitignore.

Because of this though, the first time set up of this project will not be the easiest. But when you have this done, it's all smooth sailing.

Step by Step

You'll see some of these overlap with instructions in the next documents. Part of the steps is basically creating essential files with dummy data.

  1. In Terminal, navigate to any project of your liking and clone the repo..
    git clone https://github.com/uw-it-aca/spacescout-android.git
    

Development is currently being done on the "develop" branch. To checkout that branch..
git checkout develop *reference

  1. In Android Studio, choose "Open an existing Android Studio project" or go to 'File > Open' and navigate into the 'spacescout-android' directory. Choose the 'spacescout_android' directory which may have the Android Studio icon (it's ok if it doesn't..but it's one dir deep).

  2. When you first open the project, you'll see a prompt "Unregistered VCS root detected". Choose 'Add root'.

    3.1. You may also see a prompt about importing a gradle project and notice the absence of the project folder in the 'Project' tab on the left-hand sidebar. If this happens, click on the "Import Gradle Project" on the prompt and choose the Recommended setting (something with "Wrapper") which should point to a file called "build.gradle", and continue. It will start loading things.

    3.2 [SPECIAL CASE] This happens if you already have the project on local, but you switched branches or pulled new things. You may not see the prompt in 3.1, but you won't see your project directory (even though it builds fine) and you'll notice that you can't run the app. Repeating step 2 seems to solve this.

  3. In the 'Project' tab on your left, navigate to 'SpaceScout/res/values/' [Android View] and create a file called 'apikey.xml' (we're specific because it's already in the gitignore file). Do not add to git on prompt. The file should contain these:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="googleMapsKey">AIzaSyBdVl-cTICSwYKrZ95SuvNw7dbMuDt1KG0</string>
        <string name="consumerKey">23k4k1k09470c6d2ff23665bf588fb91773bnm65</string>
        <string name="consumerSecret">m67jkace11b5cfc004e7fb1d6321f92ca7e0980a</string>
    </resources>
    

    The keys are fake

  4. Similar to Step 4, create a file called 'urls.xml' that should contain these:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="urlAll">http://dnsname:8000/api/v1/spot/all</string>
        <string name="baseUrl">http://dnsname:8000/api/v1/</string>
    </resources>
    
  5. Go to and select 'Build > Rebuild Project' and 'Build > Clean Project'.

  6. Try to run the app on an AVD. If it runs (with the "Connection Error" prompt), it works.

Now you can proceed to Getting Google Maps to Work.

Clone this wiki locally