How to Share Android Studio Project on GitHub

Creating a New Repository with Android Studio


Following are the simple steps to create a new repository with android studio on GitHub. You can share android studio project on github from any computer like Windows, Mac and Linux.

1. Download and Install Git


First, you have to install Git on your computer to create a repository with android studio on GitHub. If you have not installed Git yet in your computer following are the links to download Git for Windows, Mac and Linux.

Download Git for Windows: http://git-scm.com/download/win
Download Git for Mac: http://git-scm.com/download/mac
Download Git for Linux: http://git-scm.com/download/linux

2. Configuring the VCS


To configure the VCS, open a sample project in Android Studio.
Go to File >> Settings >> Version Control >> GitHub
If you already have GitHub account, enter your username and password then click Test button. If you see successful message, click Ok button. If don’t have GitHub account then first click in Signup

Android Studio Version Control GitHub Setting

Again, Go to File >> Settings >> Version Control >> Git and browse git.exe and click Test button. If you see successful message, click Ok button and again click Ok button at the bottom of windows. This looks like screenshot below.
C:\Program Files\Git\cmd\git.exe

Android Studio Version Control Git Setting


3. Enable Android Studio Version Control System in the Current Android Project


To activate the current android project with VCS, Go to VCS >> Enable Project for Version Control Integration from android studio menu bar.

New window appears there when you click Enable Project for Version Control Integrationand select Git in the Select a version control system to associate with the project root and click Ok button.

Android Studio Enable Project for Version Control Integration

4. Share Project on GitHub from Android Studio


From Android Studio menu bar, go to VCS >> Import into Version Control >> Share Project on GitHub.

Android Atudio Share Project on GitHub

A new window appears (Share Project on GitHub), give the name of your reposition name without white space. Here I’m using Menu Item Clickable project so my reputation name is MenuItemClickable and add description of your project in the Description box and click Share button. 

Again, when you click Share button another Add Files Initial Commit window appears. In this window, all the files are selected by default. If you have any secret file please unselect and click Ok button.

Android Studio Add Files Initial Commit window

After doing this, you will get a message of successfully shared project on GitHub. Now open GitHub in any of your browser, your project is already uploaded on GitHub.

Project in GitHub

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...