last day (14 days later) » 

10:10 AM
hi
finally :)
 
yup...:)
 
first of all,thanks for replying everytime :)
 
no prblm..;)
 
okie so
the problem
 
yes...
 
10:12 AM
i already said that i have a chat module na
 
gee..
yes...
 
i am little confused about left and right alignment rows inside Listview
fordisplaying chats
*for displaying
 
i give you a tutorial for that.
will*
 
two layouts are required ?
i mean twi xml files
*two
 
no..
only one.
 
10:15 AM
one for incoming messages and one for outgoing ?
really
then how ?
 
you just need single xml file
and then you will set programmatically its alignment where it will be
 
oh ok
 
you will required custom class here...
 
so the same textview can be aligned left and right programmatically
 
yes..
 
10:17 AM
another class again ?
okie
could u explain ?
i saw that two xmls are required
lot of places
 
no..
let me show you..
 
okies
 
create a custom class message like
public class Message{
String message;
boolean isMine;

public Message(String message, boolean isMine) {
super();
this.message = message;
this.isMine = isMine;
this.isStatusMessage = false;
}

public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public boolean isMine() {
return isMine;
}
public void setMine(boolean isMine) {
this.isMine = isMine;
}

}
 
okie
then ?
 
then you have to do in your custom list view adapter
in getview method
////////////////////////////////////////////////////////
LayoutParams lp = (LayoutParams) holder.message.getLayoutParams();
if(message.isMine())
{
holder.message.setBackgroundResource(R.drawable.speech_bubble_green);
lp.gravity = Gravity.RIGHT;
}
else
{
holder.message.setBackgroundResource(R.drawable.speech_bubble_orange);
lp.gravity = Gravity.LEFT;
}
holder.message.setLayoutParams(lp);
holder.message.setTextColor(R.color.textColor);
then just add messages in your array list like
messages = new ArrayList<Message>();

messages.add(new Message("Hello", false));
messages.add(new Message("Hi!", true));
 
10:23 AM
okie
 
read it and understand and ask if you dont get any point
 
yeah okie :)
 
;)...........
which protocol u are using for chat application..?
???...where have u gone..
 
10:45 AM
for now,i am using just a bundled json and parser
 
;/
 
for testing
 
owk..are you making this a product(mean in office) or just for learning.
 
this my btech project
hey
one thing
do u have any sample chat app like this ?
 
yes..
but i used xmpp for that
 
11:00 AM
okie let me try this again
 
xmpp is easy..
i have also created a class for this that make work easy.
but that contain few bugs...:D..:p
 
:D
 

last day (14 days later) »