loop collection android

Java
for (int i = 0; i < collection.length; i++) {
  type array_element = collection.get(index);
}
Source

Also in Java: