0

I have about 7 classes which are needed for my 2 apps. I'm using Android Studio 0.3.1 and I want to create 2 projects which are using these classes.

My concern lies with version-control, since I want my 2 apps in seperate repositories to be up to date, the moment I commit changes to the 7 classes. I don't want to merge these classes by hand in my 2 repositories.

Is there anybody who can help me with my situation?

Thank you!

EDIT: The classes are extending Android classes

HansElsen
  • 1,639
  • 5
  • 27
  • 47

1 Answers1

1

you can create a library project for those shared classes - How to create a library project in Android Studio and an application project that uses the library project

and put it into version control.

then in each of your other 2 projects include that project as a dependency.

if you're using Git, you can add it as a Git submodule, so its independent of the actual apps repositories.

Community
  • 1
  • 1
Gal Ben-Haim
  • 17,433
  • 22
  • 78
  • 131
  • Thanks for your answer. Isn't it so that if you create a module like in your link, the module is added as a subfolder of the project? This makes it hard to put under version control. – HansElsen Nov 19 '13 at 13:01
  • you need to exclude the subfolder from version control. or add it as a sub repository (version control software dependent, if you're using Git it can be added as a Git submodule) – Gal Ben-Haim Nov 19 '13 at 13:11