If your Android Studio project is Maven type, than all you need to do is add some AspectJ dependencies, MonkeyTalk-Agent dependency and make maven profile with configuration for those dependencies.
At first you will need to deploy downloaded previously (available here) jar file with MonkeyTalk-Agent for Android to you local Maven repo. If you have proper configuration of maven you can do it with following command:
mvn install:install-file -Dfile=monkeytalk-agent-2.0.4.jar -DgroupId="com.gorillalogic.monkeytalk" -DartifactId="monkeytalk-agent" -Dversion="2.0.4" -Dpackaging="jar"
When you successfully complete this part, you can edit existing POM file of you project and add following to your project dependencies:
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gorillalogic.monkeytalk</groupId>
<artifactId>monkeytalk-agent</artifactId>
<version>2.0.4</version>
</dependency>
Next step is to create maven profile that could add MonekyTalk during build:
<profile>
<id>monkeytalk</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<aspectLibraries>
<aspectLibrary>
<groupId>com.gorillalogic.monkeytalk</groupId>
<artifactId>monkeytalk-agent</artifactId>
</aspectLibrary>
</aspectLibraries>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<Xlint>ignore</Xlint>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Next step is to edit your app Manifest file giving following permission:
<!-- Monkeytalk permission -->
<uses-permission android:name="android.permission.GET_TASKS"/>
Now you project is set and ready to make MonkeyTalk app build. To to this you just need to use during project maven build process your new monkeytalk profile. Example of use in command line:
clean install android:deploy android:run -Pmonkeytalk
Now you can connect with you app trough MonkeyTalk IDE available here.