2

I used to work with Maven for my Java projects, but today I'm starting to deals with AndroidStudio.

I see it encourages to use Gradle, I've no problem to learn new tools. So I start a very basic example of Android Mobile App which just say "Hello world" when I click on a button...

I pushed the app/src into a Git repo and try to get my works on an other computer but it does not understand my project as an Android one's. I probably miss a Gradle configuration file but I see gradle.properties, build.gradle, gradle.xml, settings.gradle, .... With Maven the pom.xml file and sources/resources are enought to resume a project.

Which files do I need to push into my repo to be able to resume easily my project on any computer?

Edit : Below is the file tree I got

enter image description here

I already see the gitignore proposed into this answer but it don't talk about some files or folder I supect to be useless like app/build folder.

My AndroidStudio version is 2.3.3

Fractaliste
  • 5,777
  • 11
  • 42
  • 86
  • By default, all files go to version control. There are some that should not be versioned, and there's .gitignore for those: https://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project – laalto Oct 14 '17 at 13:12
  • _"...but it don't talk about some files or folder I supect to be useless like app/build folder."_ - yes it does, `build/` is included in almost every answer. – 1615903 Oct 16 '17 at 05:52

3 Answers3

0

Please try to figure out whether you missed any useful file to be versioned in the list of Unversioned Files. enter image description here

If you get any file that should be added to VCS then right click on file -> Add to VCS

Brijesh Kumar
  • 1,685
  • 2
  • 17
  • 28
0

I read this from web at the first place all files go to version control. So once you init a repo you should add all new files and folder you have created and commit all modification done to the source code files. In some cases you should use gitignore to ignore file you only need in your local machine for an example config files.

Following are the file you have to ignore for android studio project

*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
Nisal Edu
  • 7,237
  • 4
  • 28
  • 34
-1

First you have to enable version controlling. you can push in any repo to resume you code on any computer. first master brach will be shown. It will be better if you will push in it.

Akshay Soni
  • 109
  • 5