Q:

equivalent of arraylist in android

I have the following json format :
"Student id"
"Name" "Semester"
I want to store this information in a listView or any other data structure in android. where i want to associate the id with name and semester
Is there anything which will be useful for me?
I am a newbie with android code snippets will be helpful.
Thanks,
Bhavya

A:

There is ArrayList but you can't store all three elements pointing to each other. What you could do is create a class called Student and add Students to your list. Here's a quick example:
public class Student{
   private long id;
   private String name;
   private int semester;

   //add more methods here
}

List<Student> listOfStudents = new ArrayList<Student>

To parse your JSON, you could use the google-gson library from here.
Ryan

