0

I am trying to develop an application that allows users to chat with each other via SMS.

I have done this job. But the main problem is that now I am giving much importance to the design of my layout. I want to make my inbox conversation just like the Android built-in message inbox conversation type. I am in a fix how to do it. I have googled it, but can't find something helpful. Anyone can help me with source code would be appreciated.

user1725145
  • 3,993
  • 2
  • 37
  • 58
Developer
  • 385
  • 1
  • 3
  • 18
  • Just a thought...create your own very specific and personal-styled listview with your own listview adapter! – Pavlos Jan 08 '13 at 14:09
  • no i have done that. i have a simple list view but i want to make it more attractive and want to have almost the same look as android defualt message does like thread base inbox. – Developer Jan 08 '13 at 14:11
  • Thats what i am saying! Override every style and create your own!! The layout of each row can be a bubble for example and you will hide dividers and the stuff! – Pavlos Jan 08 '13 at 14:13
  • yes i really want this what are you saying , but alas can't do that. if you have any sample code it will be really helpful. – Developer Jan 08 '13 at 14:16

2 Answers2

2

This Blog discuss how to make a ListView with speech bubble same as native android message app or some other apps out there. I thing you can find some helpful resources there also source code is available.

K_Anas
  • 31,226
  • 9
  • 68
  • 81
  • is it possible to have the message inbox separted. I mean to say that ,how to add the conversation for different people . first in the inbox ,it will show the number of sender and after clicking that it will show the conversation between her and mine. – ligherror Jan 08 '13 at 14:41
  • you should try adding the number in the listview and when clicking one go the conversation with the person. it will do your job. – Developer Jan 08 '13 at 14:47
  • can anyone help me with source code ? please i really do need that. – ligherror Jan 08 '13 at 15:05
  • i have done that with knowing the class name.i take the class name in a string and then onlistitemclick get the positon and start the activity.But how can i do that in message inbox . Here i don't knw class name .i got stuck help me out. – ligherror Jan 08 '13 at 15:27
1

I think you can create it with a dynamic layout. first you create a container that will be placed in a scrollview after that you have to load the data (how many is the message,content of the message). After you get the data you have to create a child view to be added in the container, you can design the child as you like and add it to the container.

overall it'll be looks like this

scrollview->container->(foreach child) add child;

and the pseudocode

Scrollview svList = (ScrollView) findviewbyid(R.id.svList);
LinearLayout llContainer = (LinearLayout) findviewbyid(R.id.llContainer);
new AsyncGetMessage().execute //use asynctask to get message
for(int i=0;i<numberofchild;i++)
{
    llContainer.addView(new Child(message,who)) 
    //who is a bool value to determine your message or your friend message
}
Niko Adrianus Yuwono
  • 11,012
  • 8
  • 42
  • 64