I am including a messaging feature in my app.But I am not sure about how the incoming/sent messages can be displayed. Can anyone help me out with how the UI for the messaging apps are built e.g. goSMSPro ?
I could think of using a LinearLayout inside ScrollView and add TextViews as the messages are received or sent, or using a ListView. Is this approach correct, if not is there any better approach?
Thanks in advance
According to me, using adding TextViews inside a LinerLayout, whenever a new message is received, would not be the easiest way. Use a ListView to display the messages. ListViews are meant for such purposes only and would reduce your headache a lot. If you want to show the messages in the form of a conversation, you can align the text in each row according to the sender and the receiver.
Whenever a new message is received, just call
notifyDatasetChanged()on the ListView and the messages would get updated.