Please mind the Collaboration Policy. If you have any questions regarding the assignment, do ask the course staff.
The total number of points for this milestone is 100.
To start a Smart Chat conversation, users can click on their buddies and choose the option to chat. Moreover, during a chess game, buddies should also be able to start a conversation with the chess buddy, or initiate a new conversation with a new buddy. An example interface is in the figure below.
SmartChat should allow the user to have multiple chat sessions open in parallel. Moreover, the user should be able to start a chat session either by selecting a friend in the FriendFinder View, or by choosing the chat option while playing a chess game.
Chat messages go through the same server used so far. The format of a chat message is specified in the client-server protocol specification. Here is the excerpt relevant to chat messages:
To send a message:
For Alice to send a message to Bob, she needs to send the following command:
If the server replies with ACK to Alice, Bob will receive:
The requirement for translation is that SmartChat figures out automatically the language the user is writing in. The user does not have to configure any language preferences. All incoming chat messages will be translated in the language of the user. For instance, if Alice is writing in English and Bob is writing in French, all messages from Alice to Bob will be translated by Bob's BuddySuite from English to French.
For translation you should use the Google Translate Java API.
You have to provide a search function that allows users to search through previous chat messages. The chat log has to be persistent across reboots of the BuddySuite application and of the phone. The log is likely to be large and not fit in main memory, therefore you must store it on the phone's persistent memory or on the sdcard.
To create an sdcard image to be used with the emulator, you can run a command similar to:
To start the emulator with an sdcard, you can run a command similar to:
You are allowed to store the chat log in any format you like and use any functionality provided by the Android SDK to perform the search.
Users should be able to load a plain text file into the chat log. For this, you need to provide a way to input the name of a file on the sdcard and a button to load it into the chat log. Each line of the plain text file loaded should be added to your internal chat log representation. This functionality is worth 5 points.
For privacy reasons, users should be able to clear the chat log (i.e., erase the entire content of the chat log and create a new empty log). For this, you will receive 5 points.
For instance, for the following chat log:
You have to profile your application to see any performance bottlenecks. For performance profiling you will use TraceView. Follow the instructions in the TraceView tutorial to see how to collect performance statistics and how to display them. To enable profiling the entire application, place the call to startMethodTracing() in your activity's onCreate() method, and call stopMethodTracing() in that activity's onDestroy() method.
Your goal is to profile the search functionality and see what percent of the entire execution time is occupied by the search. The format you store the chat messages will likely influence the performance of the search. To profile the performance of your search, you will search through this test file, made out of some of the Linux source code files, for the string "epfl".
Your milestone documentation should contain a snapshot similar to this one. Write down in your README file the number of inclusive cycles and the percentage for the top search method. Also include the profile trace, so that the TAs will be able to view it in TraceView. You will receive 15 points for implementing the search functionality, and 20 more points if the search method is faster than 2600 inclusive time while searching for the string "epfl" in the test file (the inclusive time is shown in the third column in TraceView).
Please send an email to the SwEng Staff with the link to the SVN repository where your project is located. Remember, the structure of the folder defined by the address you provide must pass the check_structure.bat test. The link to your SVN repository should be sent by December 7th, the latest.By December 8th, you have to hand in:
Q: Is the language detection supposed to be automatic?
A: Yes, the chat should infer the language automatically based on the messages typed already by a user. Sometimes you may not auto-detect with high accuracy, but you can pick the best guess. You should not ask the user about the language or look into the local properties.
Q: How can one get the points for milestone 5?
A: - milestone 5 has 100 points
- milestone 5 weighs as much as the other milestones
- you can only get the points for milestone 5 if your score for milestone 4 is above 95