O'Reilly logo

Android NDK Beginner's Guide by Sylvain Ratabouil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – saving a reference to an object in the Store

Let’s start again with the Java code:

  1. To help us handling operations on arrays, let’s download a helper library: Google Guava (release r09 in this book) at http://code.google.com/p/guava-libraries. Guava offers many useful methods to deal primitives and arrays and perform "pseudo-functional" programming. Copy guava-r09 jar contained in the downloaded ZIP in libs.
  2. Open project Properties and go to the Java Build Path section. In the Libraries tab, reference Guava jar by clicking on the Add JARs... button. Validate.
  3. Edit StoreType enumeration initiated in previous parts and add two new values the IntegerArray and ColorArray:
    public enum StoreType {
        Integer, String, Color,
     IntegerArray, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required