Search code examples
androidandroid-studioonenotelive-sdk

How do I import Microsoft's LiveSDK into an Android Studio project?


Microsoft provides a set of instructions on how to import the LiveSDK into an Eclipse project, but they do not provide instructions on how to do it using Android Studio.

How would these steps be replicated using Android Studio?

enter image description here


Solution

  • Warning - this answer contains a minor rant...

    I'm using a different Microsoft library for Android (in my case SignalR). For both the library that you are using and the one that I am using, Microsoft describes the same methods for using the libraries, which basically amounts to sticking their source code into your project.

    It's actually a half-step away from that - they have you set it up as dependent project (in Eclipse). In Android Studio, you could create two separate modules in your project, and then have your application module depend on the Microsoft library module.

    That will work, but it's damn ugly. They should just distribute a library (a .jar file, or a .aar if necessary). Better yet, they could publish the .jar or .aar to the Maven central repo. That's the (sane) way that code reuse works in the Java World (and by extension the Android World).

    My solution has been to compile their library, create a .jar file, and then publish that library to my own Nexus server. Then the dependency becomes just another dependency line in the build.gradle file.

    I'd really prefer that if Microsoft is going to publish Android libraries, they would figure out how the environment works, and publish libraries the way everyone else does.