Connecting Android Studio Project with BitBucket
Android Studio can out-of-the-box work with GitHub but not with BitBucket. There are a lot of tutorials on the Internet which describe a way to work with a BitBucket Repository and an Android Studio Project mostly by using the inbuilt Terminal Window from Android Studio.
This Tutorial is not about using the Terminal Window. All the Push, Pull, Commits, etc. are done from the VCS menus inside the Android Studio IDE.
First, you need to download the BitBucket Plugin:
Don’t unzip the file.
In the next step, we are going to install the Plugin. If Android Studio is already open with one of your projects, go to the settings button in the toolbar and choose Plugins.
The same menu can also be reached from the Welcome screen:
Configure -> Plugins
Choose the option <Install plugin from disk ..>
and navigate to the downloaded Plugin. Choose the .zip file and click <OK>.
Restart Android Studio and the Plugin is ready to use.
Start a new Android Studio Project or use the one you have already open.
The Project needs to be activated for using VCS.
Like GitHub, BitBucket is based on Git.
This is similar to the connection with a GitHub Repository.
But the Share did not work in my tests. It’s worth to try it. Maybe it works with another OS or an updated version.
I did this with Ubuntu 14.04.
What I did instead was:
Creating a Repository on the Web at BitBucket, with exact the same Project Name.
Take notice of the line:
git remote add origin ….
you will need only the HTTP address from this line.
Fill in the HTTP address from BitBucket
After that, I was able to commit and push the “Changes”. The Online Repository did not have any files after creating. So, the commit and push, brings up all the files I have in Android Studio.
The control Online at BitBucket shows the new Repository.
To import an Android Studio from BitBucket worked in my tests too.
To do this, pick from the Welcome screen “Check out project from Version Control” and choose BitBucket.
Use the Pulldown menu to choose the project you want to import.
Click through the import process and wait that the project opens. That’s it.