Mobile Services Project Report: Home Automation Mobile Application
Mobile Services Project Report: Home Automation Mobile Application
[HAMA]
7 September 2009
June 8, 2009 Home Automation Mobile Application Report
Table of Contents
Topic page
Architecture: ....................................................................................................................................... 3
Implementation: ..................................................................................................................................... 4
2
June 8, 2009 Home Automation Mobile Application Report
The purpose:
The purpose of this document is to outline and illustrate the development procedures carried
out for HAMA , a mobile application designed to enable potential users who may be interested
in controlling their home devices such as turning on the house lights, off/on setting of the
alarm and closing curtains from their mobile phones.
Architecture:
HAMA is a client/server application that uses a simple architecture with two mobile phones,
with mobile1 serving as a client and mobile2 serving as server. The communication between
the two mobiles is carried out in a form of sms (the short service message). The event to send
the message is triggered by the user with the client mobile and is transferred through the
sender to the server.
Figure 1 Shows the HAMA system architecture, gives a picture of how the messages are to be send from the
client to the server
3
June 8, 2009 Home Automation Mobile Application Report
Implementation:
The Code Structure
The application has a home package which consists of two classes:
1. House MIDlet
- Implementing the graphic user interfaces of the application, has a main form with a
choicegroup mechanism that’s a host of the house items [Lights, Curtain and Alarm]
- The house items provide users with selectable options available for possible
adjustments, users can select between light 1 through light 4 which they switch
on/off. A number of curtains are available and they could be adjusted by a gauge,
the alarm has an On/Off setter.
2. Sender class
- This is the application’s message sending component. One of the methods of this
class, the sendMsg takes three parameters (Receiver, Port and Message), its purpose
is to initialize the message receiver, the port, the message to be sent. It is in this
class where the thread is initiated.
- Also contained in the sender class is the sendSMS, it is responsible for sending the
sms. It defines the address to which the sms is to be sent and the connection.
3. History class
The model package implements the History class which is a host of a RecordStore
mechanism responsible for record storage management, capable for loading, saving and
retrieving records.
4
June 8, 2009 Home Automation Mobile Application Report
1. Launching HAMA
Figure 2 HAMA after ran
When the application is launched, the application’s main form with the capability to allow user
to select the house items is prompted.
5
June 8, 2009 Home Automation Mobile Application Report
Warning message:
If the user did not input the mobile number to connect the message is not send and a warning
alert is displayed.
6
June 8, 2009 Home Automation Mobile Application Report
Fig 1.3 Default status of house lights viewed from the server screen on the left, the screen on the right shows a client mobile screen(+555
0000) ready for sending a sms to a mobile phone whose number is +555 0001
When the message is sent from mobile +555 0000, the status of the screen will be updated and
the selected status from the sender should be reflected on the server.
Generally, features statuses could be viewed by hitting the view status command on the menu.
7
June 8, 2009 Home Automation Mobile Application Report
Figure 8 shows a left screen set for sending a message from the client to the server, the right screen is an
updated version of the server after the message has been received
8
June 8, 2009 Home Automation Mobile Application Report
9
June 8, 2009 Home Automation Mobile Application Report
Figure 11 shows a sender screen on the left and the updated screen of the alarm status
10
June 8, 2009 Home Automation Mobile Application Report
11
June 8, 2009 Home Automation Mobile Application Report
References:
Sing Li and Jonathan Knudsen, Beginning J2ME, (3rd Ed.) Apress, 2005
12