Android have their own implementation of HashMap, which doesnt use Autoboxing and it is somehow better for performance (CPU or RAM)?
https://developer.android.com/re
ArrayMap uses way less memory than HashMap and is recommended for up to a few hundred items, especially if the map is not updated frequently. Spending less time allocating and freeing memory may also provide some general performance gains.
Update performance is a bit worse because any insert requires an array copy. Read performance is comparable for a small number of items and uses binary search.
Is there any reason for you to attempt such a replacement?
If it's to improve performance then you have to make measures before and after the replacement and see if the replacements helped.
Probably, not worth of the effort.
You should take a look at this video : https://www.youtube.com/watch?v=ORgucLTtTDI
Perfect situations:
1. small number of items (< 1000) with a lots of accesses or the insertions and deletions are infrequent enough that the overhead of doing so is not really noticed.
2. containers of maps - maps of maps where the submaps tends to have low number of items and often iterate over then a lot of time.