anne@Inspiron-15R:~$ git clone https://github.com/udacity/ud839_Miwok.git Cloning into 'ud839_Miwok'... remote: Counting objects: 809, done. remote: Total 809 (delta 0), reused 0 (delta 0), pack-reused 809 Receiving objects: 100% (809/809), 2.26 MiB | 1.90 MiB/s, done. Resolving deltas: 100% (248/248), done. anne@Inspiron-15R:~$
Started the above today. Importing the Miwok project went seemlessly…
- Go to this GitHub project repository link.
- Click on the “Download zip” button to download the app code.
- Unzip the downloaded file on your computer so that you have a “Miwok” folder.
- Open Android Studio.
- Choose File > Import Project and select the “Miwok” folder. It may take some time for the project to be imported. If you have any issues, check the Troubleshooting document.
- Once that app has successfully imported, run the app on your Android device (phone, tablet, or emulator). It should look like this screenshot. Nothing happens when you click on any of the categories. That’s expected.
Just for your information, during the process of importing the project, Android Studio prompted for some updates and gave warnings related to obsolete features being replaced. This is due to the fact I am using the bleeding edge version of Android Studio, and the project I’m importing was written months previously. So it took a few minutes to complete the updates and build, the installing the APK to the phone took minutes instead of the seconds it has taken so far with my apps. Nevertheless, all went seemlessly (if slowly) and the app ran as described on the phone.
This below is from the above:
- Sign up and create a GitHub account in www.github.com.
- Download git from https://git-scm.com/downloads and install it in your system.
- Open the project in android studio and go to File -> Settings -> Version Control -> Git.
- Click on test button to test “path to Git executables”. If successful message is shown everything is ok, else navigate to git.exe from where you installed git and test again.
- Go to File -> Settings -> Version Control -> GitHub. Enter your email and password used to create GitHub account and click on OK button.
- Then go to VCS -> Import into Version Control -> Share Project on GitHub. Enter Repository name, Description and click Share button.
- In the next window check all files inorder to add files for initial commit and click OK.
- Now the project will be uploaded to the GitHub repository and when uploading is finished we will get a message in android studio showing “Successfully shared project on GitHub”. Click on the link provided in that message to go to GitHub repository.
My extra notes:
When you’ve made a change to a file, select the file or directory in the Project window, select main menu VCS -> Commit… -> Commit and Push. Notice after you’ve created a project for a repository in GitHub (via Android Studio as described in the 8 steps above) any changes to a file changes the colour of the file name to remind you to commit and push it to the repository.
This below is from the above link at the very bottom of the page:
The most important thing we forgot here is ignoring file. Every time we run gradle or build it creates new files which are changeable from build to build and pc to pc.We do not want all the files from Android Studio to be added to Git. Files like generated code, binary files (executables) should not be added to Git (version control).So please use .gitignore file while uploading projects to github. It also reduces the size of project uploaded to server.
- Go to root folder.
git add .
- Create .gitignore txt file in root folder. Place these content in file.
git remote add origin https://github.com/username/project.git
git commit - m "My First Commit"
git push origin
Note : As per suggestion from different developers, they always suggest to use git from command line. It is upto you, how you prefer it most.