The only purpose of these methods in B4A was to allow developers to iterate over the Map items. This was before the For Each loop was available.
A standard Map structure doesn't support these methods so adding them requires a more complicated (and less optimized) structure.
B4X:
For Each k As String In Map.Keys
Dim v As Object = Map.Get(k)
...
Next
This code is faster and doesn't require a custom structure under the hood.
The only purpose of these methods in B4A was to allow developers to iterate over the Map items. This was before the For Each loop was available.
A standard Map structure doesn't support these methods so adding them requires a more complicated (and less optimized) structure.
B4X:
For Each k As String In Map.Keys
Dim v As Object = Map.Get(k)
...
Next
This code is faster and doesn't require a custom structure under the hood.
The reasoning is logical, however there is one profound reason why you should implement these methods: to maintain the promise of a cross-platform suite. Migrating large projects from B4A to B4i is mostly unobtrusive, however these sort of inconsistencies slow the process.
It is not possible to add these methods without a building a completely new collection (with worse performance, more overhead and less flexibility). As these methods are deprecated and there is a better alternative I decided that they will not be implemented.
Can I trust, the loop below to return the keys in the same order as if I used I used B4A, "Map.GetKeyAt(i)" and "Map.GetValueAt(i)" .
B4X:
For Each k As String In Map.Keys
Dim v As Object = Map.Get(k)
...
Next
In other words
B4X:
Dim iLoopIndex As Int = 0
Dim iKeyIndex As Int = 5
For Each k As String In mLocalMap.Keys
Dim v As Object = mLocalMap.Get(k)
...
If iLoopIndex = iKeyIndex Then
Exit
End If
iLoopIndex = iLoopIndex + 1
Next
Is k = GetKeyAt(5) ??? assuming that map size is > 6