First Version

This week, I mainly finished server things: Server configure dialog, Implementation of switching room, separate message list for different recipient, font awesome icons for MediaGrid.

For the server configure, I save the server IP and port into SharedPreferences, so next time it shows user’s last configuration.

For the switching room, first an Alert dialog is shown for user to input a room id. Then it clears the message queue, message showing list, and interrupts three long polling thread including longPollingChat, longPollingUser, longPollingIM. Then saveUserDoc is recalled to restart a new room, and reset long polling thread.

1

For the separate message list, I created a HashMap to map the user name to its corresponding message list. Every time when message is reached, it is written into its message list. And if the message recipient is the same as the recipient that user choose, then message is shown to the list view.

23

For the font awesome part, the non-system font could be only add with java code dynamically. So I created a getFontAwesome() function in GlobalUtil to load the font data. And the most annoying part is the icon of an item in a list view. Because I’m unable to specify the font in the xml file of an item, I have to extend the SimpleAdapter’s getView() method to specify the font.

45

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s