This exercise is designed to evaluate your ability with using the broad spectrum of techniques you have learned this year, including OO techniques, dynamic data structures, event based programming, Swing and using the Java API to discover how to use classes written by other programmers in your applications. Unlike the previous assessed exercise, you are completely free to choose what classes, methods, variables you need to complete the exercise...
Your task is to design and build a java application capable of sending text messages to, and receiving text messages from, other such applications in the 1st year java lab. This application should use a GUI similar to that of a mobile phone.
To give you an idea of what to build, here's a screenshot from one we made earlier... Why not see how close you can get your application to looking like this? But of course, if you think you have a better design for a mobile phone, feel free to indulge yourself... See image.
You haven't had the chance to study much computer networking yet, and we don't expect you to be able to write the communications part of an application like this on your own, so we've written it for you. It's called the GSMNetwork package.
The GSMNetwork package was developed here at Lancaster, is written completely in java, and is capable of sending messages to, and receiving messages from java applications. The package is very easy to use, and doesn't employ any techniques you haven't already seen before.
You can download the GSMNetwork.jar file from here the coursework page on LUVLE, and can integrate it into your Eclipse project in the same way as previous exercises (See the Week 12 Solar System exercise for details on how to do this if you’ve forgotten).
To find out more about how to use the GSMNetwork package, consult the GSMNetwork Javadoc documentation, also uploaded onto LUVLE. If you’re still unclear on any aspects, ask you tutor to explain it to you. You’ll find the documentation on LUVLE labelled: GSMNetwork API Documentation.zip
The GSMNetwork package uses something called Java RMI to enable its communications. RMI stands for Remote Method Invocation, and is something beyond the scope of this course (but you will be learning it if you go on to Part II). There is one thing you need to do in order to allow the GSMNetwork package work its magic on your machine though - you need to have a program running in the background called 'rmiregistry'. Before you start programming, you should:
The following sections describe the functionality you should aim to achieve in your application. You needn't do these tasks in any strict order, but they are listed in an order that helps you evolve your program in more manageable pieces. Completing the main parts of Tasks 1 and 2 will be sufficient for a bare pass mark.
The aim of this task is to develop a two very simple applications (no Swing GUI yet!), one of which can send a message, and one which can receive a message. As a guide, each of these applications can be written in around 10 lines of code.
Develop the code you wrote above to include a graphical user interface that resembles a telephone. You can try to build one that resembles the picture above, or design one of your own. Integrate code you wrote in task 1, so that your GUI can both send and receive messages.
For extra marks on the GUI:
Real mobile telephones store received text messages, so that you can look back at a later time and re- read your messages...
If you want to experiment with your program just to learn more about Java programming, there many other features you can add to your application, for example: