This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes What to use instead of Arraylist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "What to use instead of Arraylist" Watch "What to use instead of Arraylist" New topic

What to use instead of Arraylist

Riamor Von Trapp

Joined: May 04, 2011
Posts: 12

Since ArrayList isn't available in JME, what should I use instead?
I'm new to Java, had used ArrayList on the PC version of my program.

I'm trying to store a list of bluetooth devices, with the friendly name and bluetooth id.
From what I can tell, I can use a Vector instead. But bearing in mind the limitations of mobile devices, is that the best route?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16895

Vector is the grandparent of all of Java's collection classes. It should be OK.

The main reason why Vector is out of favor these days is that (like StringBuffer) it adds the overhead of a thread-lock to its operations (they run synchronized). However, I don't think I'd worry about that on a mobile device.

Customer surveys are for companies who didn't pay proper attention to begin with.
It is sorta covered in the JavaRanch Style Guide.
subject: What to use instead of Arraylist
It's not a secret anymore!