If you use maven android sdk deployer you can use the following : 
```xml
<dependency>
  <groupId>android</groupId>
  <artifactId>android</artifactId>
  <version>4.2_r1</version>
  <scope>provided</scope>
</dependency>
```

And you do not need to change the sample MainActivity code