By Benjamin Williams 2002
School of Information Technology and Electrical Engineering The University of Queensland
Benjamin Williams 5 Garson Place MC DOWALL, BRISBANE 4053 Ph. (07) 33533607 Mobile. 3842662046 s354399@student.uq.edu.au
To the Head School of Information Technology and Electrical Engineering The University of Queensland St Lucia, QLD 4072 Dear Professor Kaplan, In accordance with the requirements of the degree of Bachelor of Engineering in the division of Electrical Engineering, I present the following thesis entitled ”Java applications for a Bluetooth Platform”. This work was performed under the supervision of Dr Adam Postula. I declare that the work submitted in this thesis is my own, except as acknowledged in the text and footnotes, and has not been previously submitted for a degree at the University of Queensland or any other institution.
Yours Sincerely Benjamin Williams
Acknowledgements
Thank you to Dr Adam Postula, Henry Valk and Paul Logothetis for your assistance with this project.
Thank you to Mum, Dad, Mark, Michael and Susan for your support through out the year.
Abstract
In March 2002 a final year thesis project was undertaken based on a suggestion by Henry Valk of HCV Wireless to investigate the development of a Java application for a Bluetooth platform. The Bluetooth standard is a short range wireless technology that allows different types of devices to form automatic, spontaneous networks. Java applications are portable, secure and robust, which makes them suitable for users of Bluetooth devices to wirelessly download and use to access a service.
There were three main aims of this project •
To analyse the features and limitations of Bluetooth and Java technology and investigate what scenarios could benefit from a wireless application implemented using this combination.
•
To define a specification for an experimental Bluetooth/Java application and
Bibliography: ...............................................................................................................76 Appendix A – MIDP Application Screens ...................................................................80 Appendix B – MIDP Application Classes....................................................................83 Appendix C – MIDP Application Command Actions ..................................................86 Appendix D – MIDP Application Source Code ...........................................................88 Appendix E – Server Application Source Code ......................................................... 106 Appendix F – Gateway Source Code ......................................................................... 109 Appendix G – Old Java Bluetooth Interface Source Code.......................................... 116 Appendix H – Revised Java Bluetooth Interface Source Code ................................... 123 129 Table of Figures Figure 1. The Bluetooth Protocol Stack .......................................................................12 Figure 2. A Bluetooth Piconet .....................................................................................14 Figure 3. Profiles of the Bluetooth Specification .........................................................17 Figure 4. Java 2 Micro Edition Platform Architecture..................................................19 Figure 5. Topology of the network ..............................................................................39 Figure 6. Architecture of Software Components on the mobile device.........................40 Figure 7. Relationship between interfaces for the Generic Connection Framework......43 Figure 8. Network stacks for the gateway and mobile device.......................................45 Figure 9. Distributed System Layers............................................................................49 Figure 10. Using SOAP with TCP/IP/RFCOMM ........................................................55 Figure 11. Server architecture.....................................................................................59 Figure 12. Database Schema .......................................................................................60 Figure 13. The Interface for the Bluetooth connection classes ....................................62 Figure 14. RFCOMM Class........................................................................................63 Figure 15. The gateway process .................................................................................63 Figure 16. The application running in the emulator......................................................65 130