Archive for the ‘Android’ Category

Adding the Android Licensing Library to an AndroidStudio Project

Friday, May 13th, 2016

It appears that currently creating an external library is not all that easy. I wanted to add the Android Licensing Library and they advise creating a copy from it. I decided to just use a project library instead of messing around but have the sources in the repo. Here is what I did:

  • Download the licensing library with the SDK Manager
  • Copy it from the android SDK (the location is visible in AndroidStudio->Tools->Android->SDK Manager) to another location
  • Check in the library into your version control system
  • In your AndroidStudio project create a library project. Projects->New Module->Library ‘SomeName’ Package name =
  • Now with your file system browser go into the ‘SomeName’->src->main->java directory and delete the package that was created
  • Check out the licensing library into a new empty directory somewhere and go into the src dir and copy the ‘com’ subfolder
  • Copy this tree to the  ‘SomeName’->src->main->java directory (this makes sure the .svn references are now pointing to the correct repo location)
  • Now in your main project open and make sure the new module is listed there (I had to add it)
        compile project(':assetLib')
        compile project(':openGLISH')
        compile project(':mathLib')
        compile project(':ishlicensing')
        compile ''
  • Now you should be able to compile your project and check everything into svn. (note uncheck ‘Code Analysis’ if pressing the ‘Commit’ button doesn’t do anything).


Converting Eclipse Android Project with Libraries and VCS to AndroidStudio

Friday, February 20th, 2015

This thing puzzled me for a while. I have several separate libraries in eclipse and their associated SVN directories. I

  1. Did not want to duplicate sources in the repo
  2. Wanted everything under source control
  3. Wanted to use Gradle (because that seems to be Google’s preferred source build system for android)
  4. Did not mind having everything in one project instead of separate modules in Android Studio ((un)like I had in eclipse)

So what I did was the following:

  1. Import project from Eclipse by choosing ‘Import from eclipse’ from the main AndroidStudio window.
  2. Go into the project and for all sub-projects in AndroidStudio open the Java folder and delete the Java source tree (i.e. the Java directory should be empty)
  3. Warning for the next step; in your repository, make sure to create a directory for your project. Do not import into the root or it will be a mess!
  4. Check in your (now empty) android studio project by going to (Toolbar) VCS->Subversion->Share Project. So your, Android project, will be under source control in its own folder.
  5. Now for every subproject click on (Toolbar) VCS->Checkout->Browse to the root of your source (i.e. the last part of your domain name, for me it is ‘eu’)
  6. Browse to your project, subproject and then the java folder.
  7. Press Checkout
  8. Choose the option with the last directory being Java followed by the first part of your domain name (i.e. in my case again ‘eu’). So for me …Java/eu
  9. Then select ‘NO’, do not create an android studio project from it.

You should be all set. When you now commit the project itself it will go into its VCS location while the subprojects will update the existing VCS project locations.

Bonus points for anyone who figures out to do this, but then with a separate android studio project for every library. 🙂