For BlackBerry 10, you will need to use a GroupDataModel, you will be able to set sortingKeys.
I am not familiar with Android development, but I think this is what you are looking for. Since the values are stored in ArrayList, you will be able to do a java.util.Collections.sort
before you add to the listview.