2

Is it possible to do associative arrays in Android? Are there libraries that enable this, if not natively?

ina
  • 19,167
  • 39
  • 122
  • 201
  • 1
    Possible duplicate of http://stackoverflow.com/questions/5122913/java-associative-array – ajcl Jun 24 '11 at 19:38
  • Yes, the other thread was already there, but it's for Java. I was hoping there might be an associative array support in Android – ina Jun 24 '11 at 21:01

1 Answers1

2

Android supports the Java Collections Framework. You can use a Map object for associative storage and retrieval. The Java language does not support subscripting notation for associative access; you need to use method calls (get, put, etc.) for that.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • Is it possible to write associate array in Android arrays.xml file? – twlkyao Jan 03 '14 at 02:03
  • 1
    @twlkyao - Check out [this post](http://stackoverflow.com/questions/10196015/android-is-it-possible-to-define-a-map-in-an-xml-file/10196618#10196618). – Ted Hopp Jan 03 '14 at 02:56