Q: Java ListView class? What is the difference between a  listview layout xml and a Listview Java class? I am trying to make it when a user inputs text and presses enter it comes on a set position on the right but when the user receives a reply it would show up on the left side of the list view. Like text messaging on android phones. Does anyone know how i can do this? With a java class or an xml layout? I want animations and dynamic content on the listview as well. Any ideas?

A: ListActivity provides you all the built-in features of and methods of ListView but only ListView can be added into the whole Activity. By using ListView in xml, you add multiple Views such as Buttons, EditText on the same Activity.

A: Basically, the xml is for seperating the design (the visuals) from the code (functionality).
Although you can do some funcationality via xml, it's usually better to do it in Java code in your class.
I guess you can create a ListView that will iterate through 2 different list enteries:
The first will show the data (the text in your case) on left and the second entry will show on the right. For each list entery you will create a different xml layout with widgets aligned to the left and right as needed.
