Should I use HashMap in Android project?

by Daniel » Sat, 28 Jun 2008 01:25:26 GMT


Sponsored Links
 Hi All,

I did not develop mobile project before, and now I must to develop an
Android project.

example, J2ME doesn't contain HashMap class.

I think it is under the consideration of performing.

I just want to know if I use some classes, which aren't included in
J2ME, can it have great influence on performin.

Thanks
Daniel

--~--~---------~--~----~------------~-------~--~----~



Should I use HashMap in Android project?

by Romain Guy » Sat, 28 Jun 2008 01:37:52 GMT


 Hi,

HashMap is a very useful class that performs well. Without knowing how
you intend to use this class, we cannot really tell you whether it
will impact performance or not. However, HashMap can be used without
any problem in a large number of situations without impacting
performance.

The only situation in which you might want to avoid HashMap is if you
need to store primitive types (int, long, short, etc.) inside, either
as key or value. This will force you to use autoboxing which will
create new objects (Integer, Long, Short, etc.). In such a situation,
you might want to use a SparseArray instead.






-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Strange behaviour with RessourceCursorAdapter

Hi all,

I have have a little question about a strange behaviour with a
ListView wich is filled by a RessourceCursorAdapter.
The result of my query contains diferent column, where one is a
boolean use to display a picture or not.
On true value the picture appears in my custom list item.

My problem is when my list is filled with a lot of items.
ScrollBar appears, all pictures are visible... but when you scroll on
this list almost each pictures dispear :-(

Somebody already faced this issue ?
Did I forgot something? Must I force repaint or something like that ?

Thank by advance.

Regards,
Antony.

-- 

2. About Actions in Intent

Why can't i add  Intent.ACTION_CALL_BUTTON action to intent filter
registered with BR (in manifest)? it doesn't work when I tried to do
so.
Are actions specifically assigned for specific component (since this
action shows that it is Activity Action in API,see below)?


(Activity Action: The user pressed the "call" button to go to the
dialer or other appropriate UI for placing a call.
Input: Nothing.
Output: Nothing.
Constant Value: "android.intent.action.CALL_BUTTON")

-- 

3. PACKAGE_USAGE_STATS exception

4. does anyone have an idea about m3u files

5. WifiManager WifiConfiguration

6. bindService and onSeriveConnected behaviour

7. Easy Facebook Android SDK