Evaluation of Cordova Accessor Host for Rapid Development
Total Page:16
File Type:pdf, Size:1020Kb
EVALUATION OF CORDOVA ACCESSOR HOST FOR RAPID DEVELOPMENT OF IOT APPLICATIONS ON MOBILE EDGE DEVICES by Jesuloluwa S. Eyitayo, B. Eng A thesis submitted to the Graduate Council of Texas State University in partial fulfillment of the requirements for the degree of Master of Science with a Major in Computer Science May 2020 Committee Members: Anne Ngu, Chair Vangelis Metsis Guowei Yang COPYRIGHT by Jesuloluwa S. Eyitayo 2020 FAIR USE AND AUTHOR’S PERMISSION STATEMENT Fair Use This work is protected by the Copyright Laws of the United States (Public Law 94-553, section 107). Consistent with fair use as defined in the Copyright Laws, brief quotations from this material are allowed with proper acknowledgement. Use of this material for financial gain without the author’s express written permission is not allowed. Duplication Permission As the copyright holder of this work I, Jesuloluwa S. Eyitayo, authorize duplication of this work, in whole or in part, for educational or scholarly purposes only. DEDICATION This project is dedicated to my parents who have made it possible for me to pursue my master’s degree in computer science and to my siblings and close friends who supported me throughout my graduate studies. Finally, I would like to dedicate this project to God for granting me wisdom, knowledge and understanding to complete my graduate studies with a thesis. ACKNOWLEDGEMENTS I would like to first thank my thesis advisor Dr. Anne Ngu for providing me the opportunity to work with her on this thesis, for her continuous guidance and endless support during my studies both as a professor and an advisor. Thanks to Dr. Vangelis Metsis and Dr. Guowei Yang for their time and inputs into this thesis. Also, thanks to other faculty and staff members of the Department of Computer Science and the College of Engineering for their direct and indirect support and for creating an excellent learning and research environment through outstanding teaching, learning, and research facilities. I am especially grateful for the graduate instructional/research assistantship provided to me during my master’s program by the Computer Science department. I wish to appreciate my colleagues that also contributed their time and expertise to making this thesis possible. I sincere appreciate my parents, Mr. Samuel Eyitayo and Mrs. Adejoke Eyitayo; and my siblings, Jesuloba, Jesulayomi and Jesulonimi; and also my close friends for their constant love and support throughout my years of study and through the process of writing this thesis. This accomplishment would not have been possible without them. Thank you all. v TABLE OF CONTENTS Page ACKNOWLEDGEMENTS ................................................................................................ v LIST OF TABLES ........................................................................................................... viii LIST OF FIGURES ........................................................................................................... ix LIST OF ABBREVIATIONS ............................................................................................. x ABSTRACT ....................................................................................................................... xi CHAPTER 1. INTRODUCTION .............................................................................................. 1 2. RELATED IOT MIDDLEWARE SERVICE FRAMEWORKS ....................... 5 3. ACCESSOR DESIGN PATTERN AND ACCESSOR HOST .......................... 9 3.1. Overview ............................................................................................. 9 3.2. Accessor Design Pattern .................................................................... 10 3.3. Accessor Hosts .................................................................................. 13 3.3.1. The Common Host ................................................................. 14 3.3.2. The Browser Host ................................................................... 16 3.3.3. Node Host ............................................................................... 16 3.3.4. CapeCode Host ....................................................................... 16 4. CORDOVA ACCESSOR HOST ...................................................................... 17 4.1. Cordova Host ..................................................................................... 17 4.1.1. Installation of the Apache Cordova ........................................ 18 4.1.2. Cordova Plugins ..................................................................... 19 4.1.3. Building a Cordova Plugin ..................................................... 20 4.2. Architecture of Cordova Accessor Host ............................................ 21 5. EXPERIMENT ................................................................................................. 23 vi 5.1. Overview ........................................................................................... 23 5.2. The Setup of Cordova Accessor Host ............................................... 23 5.3. Accessors of the Fall Detection Application ..................................... 24 5.3.1. Data Collection Accessor ....................................................... 26 5.3.2. Data Prediction Accessor ....................................................... 26 5.3.3. Alert Accessor ........................................................................ 26 5.3.4. Display Accessor .................................................................... 27 5.4. Accessors of the Heart Rate Monitoring Application ....................... 27 5.4.1. Data Collection Accessor ....................................................... 28 5.4.2. Data Processing Accessor ...................................................... 28 5.4.3. Alert Accessor ........................................................................ 28 5.4.4. Display Accessor .................................................................... 29 5.5. Reusability of Accessors ................................................................... 29 5.5.1. Data Collection Accessor ....................................................... 30 5.5.2. Data Prediction Accessor ....................................................... 31 5.5.3. Display Accessor .................................................................... 33 5.5.4. Alert Accessor ........................................................................ 33 5.6. Portability of Devices When Using Cordova Accessor Host ............ 34 5.7. Evaluation of Battery Performance ................................................... 37 5.7.1. Battery Performance Setup ..................................................... 37 5.7.2. Observations ........................................................................... 38 6. CONCLUSION AND FUTURE WORK ......................................................... 40 APPENDIX SECTION ..................................................................................................... 42 REFERENCES ................................................................................................................. 49 vii LIST OF TABLES Table Page 1. Display of the Smartwatches and their Operating System ............................................ 34 2. Display of the Smartphones and their Operating System ............................................. 34 3. Average Battery Usage for Native (Java) App ............................................................. 39 4. Average Battery Usage for Cordova Accessor Host App ............................................. 39 viii LIST OF FIGURES Figure Page 1. Cloud-based IoT Middleware [2].................................................................................. 10 2. Design Pattern of Accessors taken from [23] ............................................................... 12 3. Hello World Accessor ................................................................................................... 13 4. Apache Cordova Architecture....................................................................................... 18 5. File Structure of the Cordova Plugin for an Android App............................................ 20 6. Cordova Accessor Host Architecture............................................................................ 22 7. SmartFall App User Interface ....................................................................................... 25 8. Main Accessors Used for the Fall Detection App ........................................................ 27 9. Main Accessors Used for the Heart Rate Monitor App ................................................ 29 10. Swarmlet.js File Architecture ..................................................................................... 30 11. Data Collection Accessor Architecture ....................................................................... 31 12. Data Prediction Accessor Architecture for the Fall Detection App ............................ 32 13. Data Processing Accessor Architecture for the Heart Rate Monitoring App ............. 32 14. Alert Accessor Architecture ........................................................................................ 33 15. Fall detection App to Receive Sensor Data from MSBAND Smartwatch ................. 35 16. Fall detection App to Receive Sensor Data from WEAROS Smartwatch.................. 36 17. Graph Showing Smartphone Battery usage of Accessor-based App Versus Native App .......................................................................................................................