views:

272

answers:

4

So. Um. The Blackberry JDE does not include java.util.ArrayList, even though it knows about java.util? What's up with that? Is there an equivalent class for BB? I don't want to use an Array, really, because I have an unknown number of objects I'm dealing with. why does the Blackberry JDE leave so much out?

-Jenny

A: 

Nevermind. Someone on a different forum explained that the Blackberry JDE uses microedition, which uses a really old version of java that doesn't even have arrays, all it has is vectors.

It's just confusing that they say they are Java, but then don't clarify that most java programmers are still going to be tripped up.

Jenny
+5  A: 

Well they are Java from a language standpoint. It just doesn't support all of the standard edition packages. It falls more inline with the microedition standards, but is way beyond J2ME from a package standpoint. They don't go around saying they're in compliance with J2SE 1.6, but it's still Java.

And of course it has arrays, unless you mean the class, Arrays. But, they have that too. It's located in package net.rim.device.api.util.

Fostah
+1  A: 

You can add it into your package yourself. Get the ArrayList implementation and just add it into your project. You will also need to get the implementation for AbstractCollection, AbstractList, Collection, Comparable, ConcurrentModificationException, Iterator, List and ListIterator.

I have a project that has a java.util package and I have put all of these classes in there and I can now use ArrayList :). You will have to modify the classes slightly to use rim imports rather than standard java imports where necessary, but it can be done if you really want ArrayLists.

DaveJohnston
+1  A: 

Yeah, Blackberry isn't J2SE, but it's not J2ME neither. Check out:

I have doubts about impossibility of doing with those classes something you can do with ArrayList.

Great article: BlackBerry API Hidden Gems (Part Two)

Max Gontar
Thanks for the information!
Jenny
You're welcome!
Max Gontar