To help us handle operations on arrays, let's download a helper library, Google Guava (release 18.0 at the time of writing this book) available at http://code.google.com/p/guava-libraries/. Guava offers many useful methods to deal with primitives and arrays, and perform "pseudo-functional" programming.
Copy guava jar
in the project libs
directory. Open the Properties project and go to Java Build Path | Libraries. Reference Guava jar by clicking on the Add JARs... button and validate.
Edit the
StoreType.java
enumeration and add three new values:IntegerArray
,StringArray
, andColorArray
:public enum StoreType { ... Color, IntegerArray, StringArray, ColorArray }
Open
Store.java
and add new methods to retrieve and saveint
,String
, andColor
arrays:public class Store { ... public native int[] getIntegerArray(String pKey); public native void setIntegerArray(String pKey, int[] pIntArray); public native String...