Sunday, February 14, 2016

How to Setup an Android Project Using GitHub Desktop and Eclipse.

The first task you would want to do when you begin to work on a project is to create a project.  I will be using GitHub to place all of your code to show to a prospective employer and Eclipse as the integrated development environment (IDE).

GitHub



Let's begin by going onto GitHub and setup a new project.  Click on the New repository button to begin.

You will now see a create a new repository page.

Now you can type in a repository name.  For the purpose of this exercise, I will type in "CowsBells" for a repository name.  You have an option to add a description, make it public or private as well as initialize this repository with a readme file.  The description I will use will be "repository for the CowsBells app."  I will set the repository to public (setting it to private would ask you to upgrade from free to micro) and add a readme file.  Click on "Create repository" and you will see the newly created repository.

Eclipse

Open up Eclipse and click on File->New->Project.  You will see a new project window.  Click on the project desired (for this exercise, Android Application Project) and then Next

Next, you will see the Android Application window, fill in "CowsBells" for application and project names and "com.danielburgnerjr.CowsBells" for package name.  Set minimum SDK to 8 and target/compile with SDK to 23.

Now to configure the project, set the path to the directory desired and click Next.

Then, go to the Configure Launcher Icon window and click Next.

Go to the Create Activity window and click Next.

Finally, go to the Blank Activity window and click Finish,

Final steps
Return to GitHub and click on this icon to save repository to computer using GitHub Desktop.
GitHub Desktop will open and a new window will open asking you to choose a directory to clone the repository into (close out of that for it will fail since the directory already exists).

Click on the + icon to add a new repository.  From there, you will be asked to select the directory for the new repository.

Next, you will see new files from Eclipse.  Type in "Initialized project" for summary and description and click on the Commit to master button to commit the files.

Click on Publish to publish changes to remote (Tip:  Click on the gears icon to access repository settings and add the SSH path in the remote section).

This is your end result.  Your project files on Eclipse have been merged with the repository on Github and you can start adding features that will eventually result in app that you can publish to the Google Play Store.

No comments:

Post a Comment