Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Version control and Android Library Projects

When using Android Library Project does anyone have a good solution for version control for projects that utilise these librarys?

For example if I have two apps, say a free version and paid, or phone and tablet, or any other scenario, and i want them to use some shared library's which are contained in an Android Lib Project, how can i safely add these projects to SVN? As they are seperate projects I have no way i know off enforcing that when one is committed the other (library one) is also.

I am using Eclipse with the Subclipse SVN plugin, does anyone know if there is a way to link the projects so a commit on one will commit the other?

Any tips here would be welcome - as I am relatively new to SVN - so may be thinking about this in the wrong way :)

Thanks

like image 935
Dori Avatar asked Feb 23 '11 10:02

Dori


People also ask

What is the difference between AAR and jar?

Unlike JAR files, AAR files offer the following functionality for Android applications: AAR files can contain Android resources and a manifest file, which allows you to bundle in shared resources like layouts and drawables in addition to Java classes and methods.

How do I organize my Android projects?

Android applications should always be neatly organized with a clear folder structure that makes your code easy to read. In addition, proper naming conventions for code and classes are important to ensure your code is clean and maintainable.

How do I obfuscate an Android library project?

In order to obfuscate your library what you need to do is: Make sure gradle settings for lib module state minifyEnabled true . run ./gradlew assemble{flavor}Release.

What is an Android library?

Libraries are often used to provide common functionalities that can be reused by other applications. The structure of an Android library is the same as that of an Android app module. Among other things, the library can include source code, resource files, and an Android manifest.


2 Answers

You cannot enforce that both are committed at the same time (that's just not how SVN works), but you can still do it (by, as bigstones said, using Ctrl+Click or putting both of them in a Working Set, and committing that).

The way Android handles libraries is indeed quite flawed, and this is one of the reasons for it.

like image 200
Timo Ohr Avatar answered Sep 22 '22 18:09

Timo Ohr


I'm quite new to versioning too, I'm using Subclipse too, I don't know if there's a way to commit both project and lib at once (if not selecting both with ctrl-click), but actually the "modified" icon is pretty visible and I never forgot about it.

The problem for me is that sometimes I modify the source opening it from the lib project, sometimes opening the source referenced in the app project, and I must remember to refresh the other. In case I forget it, in the second case, the lib project won't show the "modified" icon, so I end up refreshing both projects very often.

like image 33
bigstones Avatar answered Sep 22 '22 18:09

bigstones