Cross-Platform Development of Smartphone Application with Rhomobile
Total Page:16
File Type:pdf, Size:1020Kb
Masaryk University Faculty of Informatics Cross-platform development of smartphone application with RhoMobile Master’s Thesis Bc. Adam Melkus Brno, Spring 2016 Masaryk University Faculty of Informatics Cross-platform development of smartphone application with RhoMobile Master’s Thesis Bc. Adam Melkus Brno, Spring 2016 Declaration Hereby I declare that this paper is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Bc. Adam Melkus Advisor: Ing. Mgr. et Mgr. Zdeněk Říha, Ph.D. i Acknowledgement I would like to thank my supervisor Ing. Mgr. et Mgr. Zdeněk Říha, Ph.D. for enabling me to write this thesis and being patient with my erratic progress. I would also like to express gratitude to my technical consultant with Y Soft Mgr. Juraj Michálek and Mgr. Jaroslav Klech for the frequent insightful consultations, valuable advice and guidance. And finally thank you to my loving family and girlfriend. iii Abstract The aim of this thesis is to develop a showcase application to demon- strate the possibilities RhoMobile cross-platform development frame- work offers. Other goals include evaluation of the support, quality of documentation, community, and overall viability for commercial use. iv Keywords smart phone, Android, iOS, Windows Phone 8, RhoMobile, cross- platform v Contents 1 Introduction 1 2 Cross-platform Development of Mobile Applications 3 2.1 Motivation and Caveats ....................3 2.2 Approaches ..........................4 2.3 Overview of Frameworks ...................5 2.3.1 Hybrid Application Frameworks . .5 2.3.2 Native Application Frameworks . .6 3 RhoMobile Suite 7 3.1 Introduction ..........................7 3.2 History ............................7 3.3 Components ..........................8 3.4 Pricing ............................9 3.5 Framework Architecture ................... 10 3.5.1 Requirements for Development . 10 3.5.2 Device Requirements . 11 3.6 Setup ............................. 11 3.6.1 Windows . 12 3.6.2 OS X . 12 3.6.3 Target Platform Specific Configuration . 12 3.7 Support ............................ 14 3.8 Security ............................ 15 3.9 Rhodes development activity ................. 16 3.9.1 Future of development . 18 3.9.2 Tool for Gathering Data from GitHub . 18 3.10 Documentation ........................ 19 4 Rhodes Application 23 4.1 Application Basics ...................... 23 4.1.1 Languages and Technologies . 23 4.1.2 Creating an Application . 24 4.1.3 Configuration . 24 4.1.4 Running an Application . 25 4.1.5 Application Architecture . 27 4.2 Rhodes functionality ..................... 29 vii 4.2.1 NFC . 30 4.2.2 Camera . 31 4.2.3 Barcode Scanner . 32 4.2.4 Geolocation and Mapping . 33 4.2.5 Device Data Storage . 35 4.2.6 Notifications . 38 4.2.7 Inter-application Communication . 39 4.2.8 Native Extensions . 40 5 YSoft SafeQ Application 43 5.1 Design ............................. 43 5.2 Embedded Terminal API ................... 44 5.2.1 Authenticate . 45 5.2.2 Logged User Info . 45 5.2.3 List All Jobs in Folder . 46 5.3 Start Screen .......................... 47 5.4 Sign In Screen ......................... 48 5.5 Job List ............................ 49 5.6 Job Detail Screen ....................... 50 5.7 Screens in RTL Mode ..................... 50 6 Conclusion 53 Bibliography 55 Index 57 A Charts of monthly commits 57 viii List of Tables 3.1 Pricing table 9 3.2 Supported platforms 11 3.3 Time periods and current owners of the RhoMobile suite 16 3.4 Top 10 Rhodes contributors 19 ix List of Figures 3.1 Latest working build tools 13 3.2 Example of rhobuild.yml 14 3.3 Commits per month to the master branch 17 4.1 Sign in screen on Windows Phone 8 24 4.2 Structure of the application skeleton 25 4.3 Web view with the application 27 4.4 MVC diagram 28 4.5 Basic controller 29 4.6 Basic action 29 4.7 Basic layout 29 4.8 Push message flow chart 39 4.9 Structure of a native extension 42 5.1 Start screens 46 5.2 QR reader screen 47 5.3 Additional screens 49 5.4 Screens in right to left mode 51 A.1 Commits per month, RhoMobile, Inc. 57 A.2 Commits per month after acquisition by Motorola Solutions 57 A.3 Commits per month after acquisition by Zebra Technologies 58 xi 1 Introduction Mobile devices are more common and accessible then ever. People tend to use them daily and for many different tasks besides just mes- saging and calling. The modern mobile phone became a powerhouse of functionality and as a result people want to use their phones for everything. Be it paying for things like they would with their credit card or controlling their home. These trends made tools for developing applications on many dif- ferent platforms more popular. It is important for developers to reach large number of user as efficiently as possible and these tools make it possible. Goal of this thesis is to showcase an application that serves as an accessory for printing while using the aforementioned tools. And in doing so, evaluate one of these cross-platform frameworks named RhoMobile. The application was developed in cooperation with Y Soft Corpo- ration. The company was founded in the year 2000 as part of a student project at Masaryk University. In the beginning it was focused on pro- viding printer user authentication and was the first company in the world to provide precise charging system for printing and copying. Throughout the years the company kept improving their core prod- ucts and introducing new ones such as Print Roaming and Mobile Printing. It has grown to be an international corporation with offices all over the world. In 2014 Y Soft bought majority stake in 3D printing company called be3D, which makes 3D printers, it also set up an in- vestment company Y Soft Ventures focused on assisting and investing into interesting startup companies. Y Soft also heavily cooperates with universities providing topics for bachelor and master theses such as this one, and also offering part time jobs and internships to students.[1] The next chapter focuses on an introduction of cross-platform de- velopment concepts and classifications followed by some alternatives to the RhoMobile. Third chapter describes what the suite contains, what are paid only parts, and what is freely available. It explains the history of the company that created the framework. Covers the subject of support and then it goes on to analyze the history of development and its developers. The fourth chapter explains how RhoMobile appli- cations are created, their architecture and design. Then it goes into to 1 1. Introduction detail about selected functions and illustrates their usage with code samples. The fifth and last section focuses on the application proto- type, documents the APIs1 it uses for communication with server. I also describes each screen of the application user interface and what part of the framework is used to create it. 1. API - Application Programming Interface 2 2 Cross-platform Development of Mobile Ap- plications Cross-platform development is a popular method of developing soft- ware, because creating a piece of software that can be deployed/run on multiple different platforms without major modifications is anat- tractive concept. Using this technique even small developer teams or individuals have the opportunity to reach large number of users. The most notable and popular example is Java and Java Virtual Ma- chine, using these tools developers can write and execute code on almost all operating system and platforms. The rise of modern user-friendly mobile operating systems start- ing in the year 2007, and the subsequent releases of iPhone OS 2.0 and Android 1.0 in the year 2008, caused the inception of new cross- platform development frameworks focused on these mobile platforms. The operating systems released in 2008 allowed running third party applications. 2.1 Motivation and Caveats The main motivator behind cross-platform development is cost re- duction. Put into a very simplified example: Application needs to support 2 platforms (Android, iOS), this means either two developers are needed each developing for one platform, or one developer who can develop for both Android and iOS. But in both of these cases the cost would be the same, paying 2 developers or one developer for double the time. When utilizing some cross-platform framework ideally one developer would be able to create the application for all of platforms simultaneously, thus reducing the cost by reducing the required number of developers and development time. Testing times are however not greatly affected, to deliver good user experience the application has to be tested on all platforms and as many various devices as possible. Cross-platform frameworks inherently reduce the number of possible errors in the written code because only one code- base needs to be maintained. Code maintainability is another possible advantage of these frameworks. This can also be helpful when a new 3 2. Cross-platform Development of Mobile Applications member joins the developer team, as it means less code to go through and understand. While there are seemingly a lot of great benefits to using such frameworks, there are also some potential complications and things to look out for. It is important to do a thorough research to find the right tools for the particular job. Using a 3rd party software introduces a middle man between the developer and producer of the target plat- form. That means not all new features can be accessible through the 3rd party framework right after releasing a new version of the OS. Or the application might not even run due to some incompatibilities. Major updates to the operating systems are usually released ahead of consumer release as developer previews, so the companies making cross-platform frameworks have plenty of time to get their product ready.