This is the source code for my how-to guide on Android testing, which addresses how to set up an environment in Android Studio to support unit tests using JUnit and automated UI integration tests using the Espresso and Robolectric APIs.
How To Guide to Android Testing: http://tinyurl.com/androidtestinghowto