To create a prototype mobile application that must deal with network issues when talking to a network service. For the basic assignment, you will write two java applications that run on desktop computers. For the optional parts, you can move the client to a handheld device.
In this assignment, you will create two programs: a server that simulates a classroom lecture service, and a client that simulates a mobile client for use in taking notes during the lecture.
The server should open a window with a slider in it that is used to specify which slide the lecturer is currently on. It should also create and accept connections on a socket (using java.net.ServerSocket). For each socket connection, the server should send a list of slide URLs for the initially available slides and the initial slide number (see below). The server should always make all slides up to the maximum slide number the "lecturer" has visited available, in addition to one past that maximum (so the client can prefect it). The server should send the current slide number when the as the "lecturer" changes the current slide, and a new slide URL when the next slide in the slide order has not been sent before. If multiple clients are supported (see the extra credit), all should get the same information. For the basic assignment, only one client need be supported at a time; when the client disconnects, the server should wait for a new client. The state of the server is not changed between clients; to reset the server to its initial state, it should be restarted.
The client should connect to the server. When they connect, they will receive the current slide number and a list of URLs for the currently available slides. When a new slide becomes available, they will receive it, and when the current slide number changes, they will be notified. The client should display the slide, and have a custom menu in the menu bar that has an entry for each slide (so they can switch between them). The client should fetch slides as soon as they receive the URL, but should NOT make a slide available until the lecturer switches to it. The client will not know the maximum slide number.
The client should allow the user to make notes (in "ink") on the slide. When the user clicks and drags with the left button, each new mouse position should form a sequence of strokes until the mouse is released. The strokes should be saved as a list of strokes per slide, so they can be redrawn when the user moves between slides.
Finally, the client should change to the slide the lecturer is on; when the client receives a new slide number, it should change the display to that slide. EXCEPTION: the slide should not change while the pen is pressed.
The client should be designed to run on one of our HP handhelds. Therefore, the window should fit on either a 640x240 (HP 720) or 240x320 (HP 548) screen.
Your files should be commented with your name (the name you are registered under!) and ID number. The java file should implement a class "A5" and a second class "A5Server". The files should be emailed to cs4470@cc.gatech.edu as mime attachments to a single message.
The time the mail is received will be used to determine whether or not the program is late, so be sure to allow a couple of minutes for the mail system to transmit your file if you are working right up to the deadline.
IMPORTANT: If the TA has to edit your files you will lose points. Similarly, the TA should be able to execute the class "A5", so using any other class as your main class will result in lost points.
This assignment is due before the end of the day on December 3rd, which means it must be received by 11:59pm EDT to not be considered late.
The server should take 2 arguments, a URL prefix and a maximum slide number; the slide URLs will be "prefix" + "#.jpg", where # is an integer that goes from 1 to maximum number. We have put a sample set of 21 slides in a web directory with prefix "http://www.cc.gatech.edu/classes/AY2002/cs4470_fall/isar-talk/Slide".
The server slider should have its limits set appropriately, and should signal a slide change when the user clicks on a direction arrow, or releases the slider. If the user goes more than one slide past the end of the currrently seen slides (using the slider), all the slides up to the newly selected number should be marked as seen and have their URLs sent to the client(s).
The clients must handle slides of any size, and scale them to fit on the screen. They should be scaled so they are as large as possible while preserving the aspect ratio (width/height) of the original slide.
The client should NOT pause while loading images. All of the slides must download in the background, while the user is free to interact with the program. This is the most important part of the assignment.
We will test your client and server against other clients and servers. Therefore, your server should follow this protocol:
For pointers on using sockets, see the socket section of the online networking tutorial at http://java.sun.com/docs/books/tutorial/networking/sockets/index.html. In particular, you can see how to create servers that handle multiple clients.
For pointers on how to load images, see the web page http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html, in particular the section on background image loading and their use of the Swing Worker class (http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html#SwingWorker)
If you are using a PocketPC for the optional bits, you can find the software at http://www.microsoft.com/mobile/pocketpc/downloads/default.asp. You should also download the Microsoft High Encryption Pack for Pocket PC v1.0 if you want to access the LAWN network. When we get the wireless cards, we will make them available (for the 548's); you will need to install the networking software.
There is the following extra credit possibilities:
- It is annoying when slides change automatically at inapropriate times. Therefore, the slide should not change within 1 second of the user making notes on a slide. Similarly, if the user changes the slide manually, it should not change until they move back to the same slide as the lecturer.
- It is hard to make notes on the small images available to the user. Therefore, you should add the ability to zoom in and out. Each zoom in doubles the size of the slide, and each zoom out halves the size of the slide. You should allow the user to zoom in as far as they want. You should keep track of the strokes in a way that allows the user to make notes at any zoom level. Decide on a reasonable interface to allow zoom; pay attention to the fact that this is destined to go on a handheld computer! Describe your interface in a README with your submission.
- The server should handle multiple simultaneous clients. Make sure there are no race conditions in your server if you use multiple threads.
- Demonstrate your client on an HP handheld computer (see the TA to get one: we have a number of both 720s and 548s, and will make them available on a first come first served basis. If we run out, you will have to share -- the TA will contact people to help organize sharing). We will also provide limited help with this part of the assignment; the TA can show you how to get java code (and the swing libraries) onto the handheld, as they do not support Java2 (only 1.1.3). If you want, you may use other languages for the client (such as VB or C/C++, which are available as part of the Embedded Visual Tools, a free 300+MB download from microsoft. We cannot make this available on the cluster machines, unfortunately.
- Make use of the Cooltown beacons to be notified as to which class you are in, and receive the pointer to the lecture server, instead of having this hardcoded in your program. The TA can get you a beacon, and point you at documentation and sample code; for this part, you will be on your own, although Kuleen Mehta <kuleenm@cc.gatech.edu>, who is in this class, has experience with the Cooltown software and hardware, and is available to help.