Cross-Platform Application Development; an Alternative to Native Application Development
Thesis submitted in fulfillment of the requirements for the degree of
DOCTOR OF PHILOSOPHY
By
Sanjay Kumar
Reg. No. – 5048102010215523
Under the Guidance of
PROF. (Dr.) K. P. YADAV
Department of Computer Science
Arunachal Pradesh
Month July Year 2015
TABLE OF CONTENTS
S. NO. PARTICULARS PAGE NUMBER
1 INNER FIRST PAGE 1
2 ABSTRACT 8
3 ACKNOWLEDGEMENT 9
4 DECLARATION BY THE SCHOLAR 10
5 SUPERVISOR’S CERTIFICATATE 11
6 PREFACE AND ACKNOWLEDGEMENT 12
7 ABSTRACT 13
8 LIST OF SYMBOLS 14
9 LIST OF FIGURES 16
10 LIST OF TABLES 17
CHAPTERS
CHAPTER – 1 18
INTRODUCTION 18
1.1 MOTIVATION 19
1.2 SMARTPHONE MARKET 22
1.2.1 ANDROID 23
1.2.2 IOS 23
1.2.3 WINDOWS PHONE 24
1.3 PROBLEM DEFINITION AND PROBLEM STATEMENT 24
1.4 ANALYSIS OF EXISTING FRAMEWORKS 26
1.5 NATIVE TOOLS 27
1.5.1 STRENGTHS AND WEAKNESSES OF NATIVE DEVELOPMENT 29
1.6 APACHE CORDOVA 29
1.6.1 STRENGTHS AND WEAKNESSES OF APACHE CORDOVA 31
1.6.2 PERFORMANCE OF APACHE CORDOVA 32
1.7 XAMARIN 32
1.7.1 STRENGTHS AND WEAKNESSES OF XAMARIN 34
1.7.2 PERFORMANCE OF XAMARIN 35
1.8 OTHER TOOLS 36
1.9 STRUCTURE OF THE THESIS 37
1.10 THESIS FOCUS AND KEY CONTRIBUTIONS 38
1.11 PLATFORM DIFFERENTIATION 41
1.12 CROSS-PLATFORM DEVELOPMENT 41
1.13 PROBLEMS WITH CROSS-PLATFORM DEVELOPMENT 45
1.14 CURRENT SOLUTIONS 47
1.15 UNIFIED DESIGN PROCESS 49
CHAPTER – 2 50
REVIEW RELATED WORK 50
2.1 SURVEY 50
2.2 ANALYSIS OF FRAGMENTATION IN THE MOBILE MARKET 52
2.2.1 SOFTWARE FRAGMENTATION 52
2.2.2 MOBILE PLATFORMS REVIEW 57
2.2.2.1 GOOGLE ANDROID 57
2.2.2.2 APPLE IOS 63
2.2.2.3 SYMBIAN / WINDOWS PHONE 66
2.2.2.4 BLACKBERRY (RESEARCH IN MOTION) 67
2.2.3 MONETIZATION 68
2.2.4 DEVELOPER PLATFORM ADOPTION 70
2.2.5 BRING YOUR OWN DEVICE (BYOD) 76
2.3 PLANNING THE SURVEY 78
2.3.1 CHOICE OF KEYWORDS 78
2.3.2 SOURCES SELECTION 79
2.3.3 SEARCH METHOD 80
2.3.4 INCLUSION CRITERIA 81
2.3.5 TIMELINE OF THE LITERATURE 83
2.3.6 CONDUCTING THE SURVEY 84
2.3.7 LESSONS LEARNED FROM SURVEY RESULTS 90
CHAPTER – 3 96
BASIC CONCEPTS OF CROSS-PLATFORM MOBILE DEVELOPMENT 96
3.1 CROSS-PLATFORM MOBILE DEVELOPMENT FRAMEWORKS COMPARISON ON DIFFERENT PARAMETERS 97
3.1.1 PLATFORM SUPPORT 97
3.1.2 DEVELOPMENT ENVIRONMENT 98
3.1.3 ACCESS TO NATIVE PLATFORM AND ADVANCED DEVICE-SPECIFIC FEATURES 99
3.1.4 APPROACH OF DEVELOPMENT 100
3.1.5 CODEBASE/CODE REUSE 101
3.1.6 ARCHITECTURE AND PORTING 102
3.1.7 SPEED AND COST OF DEVELOPMENT 104
3.1.8 DOCUMENTATION AND TUTORIAL AVAILABLE 104
3.2 DECISION ON CROSS-PLATFORM MOBILE DEVELOPMENT FRAMEWORK 105
3.3 APPLICATION CONCEPT AND DESIGN 107
3.3.1 ADHERING TO THE COMPARISON PARAMETERS/ASSESSMENT MATRIX 107
3.3.2 IDENTIFYING THE REQUIREMENTS AND USE CASE MODELING 108
3.3.3 APPLICATION ARCHITECTURE 108
3.3.4 IDENTIFYING THE APPROPRIATE TECHNOLOGICAL REQUIREMENTS 110
3.3.4.1 GOOGLE MAPS JAVASCRIPT API V3 110
3.3.4.2 HTML5 111
3.3.4.3 HTML5 GEOLOCATION API 112
3.3.4.4 JQUERY 112
3.3.4.5 JQUERY MOBILE 113
3.3.4.6 CSS 113
3.3.4.7 APACHE CORDOVA/PHONEGAP 114
3.3.5 IDENTIFYING AND PREPARING THE SUITABLE DATA STRUCTURE 115
3.4 PROVING THE CONCEPT 115
3.4.1 CROSS PLATFORM THE BEST CHOICE FOR DEVELOPING MOBILE APPS 116
3.4.2 HYBRID HTML5 APP DEVELOPMENT 118
3.4.3 PROS IN CROSS-PLATFORM 119
CHAPTER – 4 121
PROPOSED CONCEPT OF CROSS PLATFORM APPLICATION DEVELOPMENT 121
4.1 TECHNICAL CONCEPT 121
4.2 APPLICATION CONCEPT AND DESIGN 122
4.2.1 PROPOSED CODE LIBRARY 124
4.2.2 NATIVE PLATFORMS AND CODE TRANSFORMATION 124
4.2.3 REQUIRED WORK TO DEPLOY THE CODE ON GOOGLE PLAY STORE 125
4.2.4 REQUIRED WORK TO DEPLOY THE CODE ON WINDOWS PLATFORM 126
4.2.5 REQUIRED WORK TO DEPLOY THE CODE ON APPLE STORE 127
4.3 CODE BUILDING 128
4.3.1 CODE BUILDING FOR ANDROID 128
4.3.2 CODE BUILDING FOR WINDOWS PLATFORM 129
4.3.3 CODE BUILDING FOR IOS 130
4.4 CODDING 131
4.4.1 CODDING FOR ANDROID PLATFORM 132
4.4.2 CODDING FOR WINDOW PLATFORM 133
4.4.3 CODDING FOR IOS 134
4.5 PROPOSED CONCEPT ARCHITECTURE 135
4.5.1 ARCHITECTURE USED FOR ANDROID APPLICATION DEVELOPMENT 137
4.5.2 ARCHITECTURE USED FOR IOS APPLICATION DEVELOPMENT 138
4.5.3 ARCHITECTURE USED FOR WINDOWS APPLICATION DEVELOPMENT 139
4.6 DATABASE MANAGEMENT AND SYNCHRONIZATION 140
4.7 TESTING THE APPLICATION 141
CHAPTER – 5 142
PILOT APPLICATION 142
5.1 APPLICATION ARCHITECTURE 142
5.2 APPLICATION DESIGN 144
5.3 COMMON CODE SYNCHRONIZATION FOR ALL PLATFORMS 145
5.4 SYNCHRONIZATION OF THE DATABASES 146
5.5 CODDING FOR THE APPLICATION 146
5.6 BUILD THE APPLICATION 147
5.7 COMPILE THE APPLICATION 148
5.8 DEPLOY THE APPLICATION 149
5.9 TESTING THE APPLICATION 150
5.9.1 SIMULATORS 150
ANDROID VIRTUAL DEVICE (AVD) 151
IOS SIMULATOR 152
WINDOWS PHONE EMULATOR 153
6 CONCLUSION 154
6.1 GOAL FULFILLMENT 155
6.2 FUTURE WORK 155
7 REFERENCES 156
ABSTRACT
Mobile devices and mobile computing have made tremendous advances and become ubiquitous in the last few years. As a result, the landscape has become seriously fragmented which brings lots of challenges for the mobile development process. Whilst native approach of mobile development still is the predominant way to develop for a particular mobile platform, recently there is shifting towards cross-platform mobile development as well.
In this thesis, a survey of the literature has been performed to see the trends in cross-platform mobile development over the last few years. With the result of the survey, it is argued that the web-based approach and in particular, hybrid approach, of mobile development serves the best for cross-platform development. Using the hybrid approach, a prototype application has also been developed and built into native application for different platforms.
The results of this work indicate that even though cross platform tools are not fully matured they show great potential and reduce the cost associated in developing native mobile applications. Cross-platform mobile development is equally suitable for rapid development of high-fidelity prototypes of the mobile application as well as fairly complex, resource intensive mobile applications on its own right.
Keywords : Mobile development, literature survey, web-based approach, hybrid approach, cross-platform mobile frameworks, HTML5, jQuery Mobile, PhoneGap, Google Maps, Android, iOS, BlackBerry.
ACKNOWLEDGEMENT
It is a great pleasure to thank the many people that supported me during my Ph.D. studies.
Words will never be enough to express my gratitude to my advisor Dr. KP Yadav for his constant and precious guidance throughout my doctoral program, for the time spent on discussing and accurately reviewing all the research work of this thesis. Besides his scientific competence, I enjoyed a lot his positive attitude to make a friendly work atmosphere. I learned much more than scientific concepts from him, and his enthusiasm has been fundamental to overcome all the difficulties which arose in these three years.
Thanks also for all the opportunities to meet important people in the research field, I am really grateful for the visit of Himalayan University.
I really appreciated the opportunity to collaborate with the Software Design and Quality research group headed by Dr. KP Yadav. I found very valuable colleagues with whom I shared work and entertainment. In particular, it was a great pleasure to work with Anne, I enjoyed our long discussions that always pointed out more questions than answers. I thank to them for their close friendship they listen my troubles and to tell me her life experiences, they to involve me in barbecue events,
I want to thank the Computer Science department, in particular the SEA Group, I think that all of you are special persons.
Many thanks to my secondary school friends that even remotely make me feel never alone.
I would like to especially thank with whom I shared all my fears to be PhD students in a country like Italy where meritocracy is only claimed but not applied, and with whom I share all my birthdays, he always remembers me that I am three days older than him and I think it is the right motivation to let him paying for both celebrations.
Many Thanks to all of you, this thesis would have no sense without any person who helped in it!
DECLARATION BY THE SCHOLAR
I hereby declare that work reported in the Ph.D. thesis entitled “Cross-Platform Application Development; an Alternative to Native Application Development” submitted at Himalayan University, Arunachal Pradesh, India is an authentic record of my work carried out under the supervision of Dr. KP Yadav. I have not submitted this work elsewhere for any other degree or diploma. I am fully responsible for the contents of the contents of my Ph.D. Thesis.
(Signature of the Scholar)
Name – Sanjay Kumar
Department of Computer Science
Himalayan University, Arunachal Pradesh, India.
Date – 30 March 2018
SUPERVISOR’S CERTIFICATE
This is to certify that the work reported in the Ph.D. thesis entitled “Cross-Platform Application Development; an Alternative to Native Application Development”, submitted by Sanjay Kumar at Himalayan University, Arunachal Pradesh, India is a bonafied record of his original work carried out under my supervision. This work has not been submitted elsewhere for any other degree or diploma.
(Signature of Supervisor)
Name – Dr. KP Yadav
Affiliation –
Date – ……………….
PREFACE AND ACKNOWLEDGEMENT
This thesis is a part of the PhD in Himalayan University. A requirement of Thesis while studying in Himalayan University. I have been working as a scholar with Himalayan University; in this thesis have been a collaboration together with my research.
With a great interest in new technology, writing this thesis about Cross platform application development was a great opportunity for me to learn more about new technology in my field of work and at the same time, research a topic that would greatly benefit me in my career. This thesis have been an effort to create the cross platform application development solution that would help the developers in developing the cross platform applications.
Writing the thesis has been a truly great endeavour and one that I could not have overcome without the continued support from my loving family and wife. I would also like to thank my colleagues and friends, I could not have asked for better colleagues and I look forward to our next projects. I am also very grateful for the valuable feedback from my supervisor Dr. KP Yadav, who have lead me through the thesis with much needed help and support. Finally, I would like to use this opportunity to honour the memory of one of the best teacher I had at The University.
ABSTRACT
Mobile devices and mobile computing have made tremendous advances and become ubiquitous in the last few years. As a result, the landscape has become seriously fragmented which brings lots of challenges for the mobile development process. Whilst native approach of mobile development still is the predominant way to develop for a particular mobile platform, recently there is shifting towards cross-platform mobile development as well.
In this thesis, a survey of the literature has been performed to see the trends in cross-platform mobile development over the last few years. With the result of the survey, it is argued that the web-based approach and in particular, hybrid approach, of mobile development serves the best for cross-platform development. Using the hybrid approach, a prototype application has also been developed and built into native application for different platforms.
The results of this work indicate that even though cross platform tools are not fully matured they show great potential and reduce the cost associated in developing native mobile applications. Cross-platform mobile development is equally suitable for rapid development of high-fidelity prototypes of the mobile application as well as fairly complex, resource intensive mobile applications on its own right.
Keywords : Mobile development, literature survey, web-based approach, hybrid approach, cross-platform mobile frameworks, HTML5, jQuery Mobile, PhoneGap, Google Maps, Android, iOS, BlackBerry.
LIST OF SYMBOLS
Following is list of abbreviations and symbols found in this thesis.
ADT Android Development Tools
API Application Programming Interface
GUI Graphical User Interface
HTML Hypertext Markup Language
HTML5 Hyper Text Markup Language version 5
IB Interface Builder
IDE Integrated Development Environment
MVC Model View Controller
NIB NeXT Interface Builder
NPS Naval Postgraduate School
OpenGL Open Graphics Library
OS Operating System
OTA over the Air
SDK Service Development Kit
UI User Interface
SRS Requirement specification document
XML Extensible Markup Language
OC Operating context
DPI Dots per inch
RIM Research in motion
API Application interface
OS Operating System
SVG Scalable vector graphics
2D/3D Two dimensional, three dimensional
DOM Document object model
GPS Global positioning system
IE Internet explorer
MVC Model view controller
CSS3 Cascading style sheet version 3
SQL Structured query language
VPN Virtual private network
PHP Hypertext pre-processor
CMS Content management system
JSON JavaScript Object Notation
XML Extensible mark-up language
REST Representational state transfer
HTTP Hypertext Transfer Protocol
HTTPS Hypertext Transfer Protocol Secure
QOS Quality of service
CRUD Create, read, update, delete
URI Uniform Resource Identifier
URL Uniform Resource Locator
LIST OF FIGURES
Figure 1.1: Sampling of the mobile platforms and their various programming languages and devices…………………………………………………………………………….. 8
Figure 1.2: Worldwide smartphone sales grouped by OS, fourth quarter 2011 10
Figure 1.3: Apache Cordova architecture 11
Figure 1.4: Xamarin Platform Overview 11
Figure 1.5: Mono / Dalvik comparison 11
Figure 1.6: Thesis structure 11
Figure 1.7: Thesis structure with OS 11
Figure 1.8: Structure of a PhoneGap produced app 11
Figure 1.9: Overview of the navigation through the traditional app 11
Figure 2.1: Mobile Sale Shares Based On Operating System from 2008 to Q2 2013 11
Figure 2.2: Mobile manufacturers. Revenues, profits and volumes 11
Figure 2.3: Daily Android Activations between August 2010 and March 2013 11
Figure 2.4: Android Operating System Distribution 05.04.2012 11
Figure 2.5: Android Operating System Distribution 02.10.2013 11
Figure 2.6: Hardware Fragmentation of Menu Buttons on Android Phones 11
Figure 2.7: illustration of how android roughly maps actual sizes and densities to generalized sizes and densities 11
Figure 2.8: different iPhone models. From version 2 to 4 14
Figure 2.9: comparison of some of the iPhone models 15
Figure 2.10: Apple iOS distribution statistics. 19
Figure 2.11: iOS distribution from March 6 2012 to 15 April 2012 20 Figure 2.12: a mobile application distribution process 20
Figure 2.13: positive feedback loop process. 20
Figure 2.14: average monthly developer revenue potential for each platform 20
Figure 2.15: Platforms Where Developers Planned To Stop Development 20
Figure 2.16: Platform Popularity with Developers 20
Figure 2.17: Developers main platform choice 20
Figure 2.18: developers using each platform q3 2013 20
Figure 2.19: Search method using the query string 20
Figure 2.20: Timeline of the publications in the conferences 20
Figure 2.21: Different solution approaches and use of cross-platform tools 20
Figure 2.22: The continuum of mobile application development 20
Figure 3.1: Web-based client-server application architecture 20
Figure 3.2: Different Platforms 20
Figure 3.3: Different Platforms 20
Figure 4.1: Application Concept and Design 28
Figure 4.2: Proposed Code Library architecture 29
Figure 4.3: Native platforms and Code transformation 29
Figure 4.4: Deploy code on Google Play Store 30
Figure 4.5: Deploy code on Windows Platform 30
Figure 4.6: Deploy code on Apple Store 31
Figure 4.7: Building the code 32
Figure 4.8: Building the code for android platform 32
Figure 4.9: Building the code for windows platform 33
Figure 4.10: Building the code for iOS platform 34
Figure 4.11: Proposed Codding architecture for the given platform 34
Figure 4.12: Proposed Codding architecture for android platform 35
Figure 4.13: Proposed Codding architecture for Windows platform 36 Figure 4.14: Proposed Codding architecture for IOS platform 36
Figure 4.15: Proposed concept Architecture 36
Figure 4.16: Proposed concept Architecture working for android 36
Figure 4.17: Proposed concept Architecture working for iOS 36
Figure 4.18: Proposed concept Architecture working for Windows 36
Figure 4.19: Database Synchronization 36
Figure 4.20: Testing the Application 36
Figure 5.1: Deployment diagram of complete client-server architecture 37
Figure 5.2: Layer diagram of MVVM design pattern implementation 37
Figure 5.3: Codding in the proposed Software Development Method 39 Figure 5.4: Building the code 39
Figure 5.5: Compiling the cod 39
Figure 5.6: Deploy the code 39
Figure 5.7: Testing the Application 39
Figure 5.8: Android Virtual Device 39
Figure 5.9: iOS Simulator 39
Figure 5.10: Windows Phone Emulator 39
LIST OF TABLES
Table 1.1: Summary of native mobile tools 11
Table 1.2: Summary of Apache Cordova framework tools 27
Table 1.3: Summary of the Xamarin framework 27 Table 2.1: Survey results summarized 27 Table 3.1: Frameworks comparison results scored 27
CHAPTER – 1
INTRODUCTION
1 INTRODUCTION
We have become an “always-connected” society. Hence it will not be an overstatement to say that mobile devices have made inroads into our lives and completely revolutionized the way we live over the last few years.
“With 5.9 billion mobile-cellular subscriptions, global penetration reaches 87% and 79% in the developing world. Mobile-broadband subscriptions have grown 45% annually over the last four years and today there are twice as many mobile-broadband as fixed-broadband subscriptions.”
With the rapid technological advancements in both hardware and software fronts, coupled with broadband internet and World Wide Web, mobile computing has become ubiquitous. People use different varieties of mobile devices (tablets, smartphones, PDAs, etc.) for all sorts of different purposes; want to know when the next bus leaves, watch online movies, learn a recipe for pasta, buy a ticket for the weekend game; you name it. Just the total “smartphone” shipment volumes alone reached 712.6 million units in 2012, up a strong 44.1% than in the year 2011. This prodigious growth in mobile devices is equally complimented by the growth in mobile content or information that these devices consume. According to the research group Gartner Inc., worldwide mobile app store downloads surpassed 45.6 billion in 2012, nearly double the 25 billion downloads in 2011 which by 2016 will reach 310 billion downloads and $74 billion in revenue. Scott Ellison, vice president, Mobile and Wireless research at IDC says
"Mobile app developers will 'appify' just about every interaction you can think of in your physical and digital worlds. The extension of mobile apps to every aspect of our personal and business lives will be one of the hallmarks of the new decade with enormous opportunities for virtually every business sector."
1.1 MOTIVATION
Amidst so much of seeming opportunities, there also lie huge challenges in the development of content/ information or applications that these devices will consume or use. Challenges in developing mobile services and applications are multifold. There is a great variety of mobile standards, operating systems on different devices. Often unfortunately, one application can work on one cell phone very well, while it does not work on the other. The two main challenges that mobile landscape presents can be pointed down to device fragmentation and operating system fragmentation.
Fragmentation is the inability to "write once and run anywhere". More formally, it is the inability to develop an application against a reference operating context (OC) and achieve the intended behavior in all OCs suitable for the application. Fragmentation affects the whole ecosystem of application users, developers, content providers and distributors, network operators and device manufacturers. As for device fragmentation, we can refer to what J. E. Gir´ on et al. have rightly put as
“…in an effort to attract more public, several manu facturers incorporate special features into their models, resulting in a lack of uniformity among them. Thus, devices present different processing, memory, storage, communication and displaying capabilities. This heterogeneity causes that the application development process becomes not homogeneous for all these devices, increasing not only costs but also the possibility of creating inconsistent versions of each application (one for each device).”
Similarly operating system fragmentation also compounds the problems in mobile development. Different vendors/players in the mobile market have their own platforms running their operating systems. Apple’s iOS, Google’s Android, Microsoft’s Windows Phone, RIM’s BlackBerry OS, Symbian, etc. to name a few are the different operating systems that ply on the majority of mobile devices in use. The platform inventors and companies provide their own set of development environment and tools in the form of Software Development Kits (SDKs) targeted and optimized for their platforms. Choice of a platform relies on how deeply developers want to link the application with the underlying operating system, as capabilities in one operating system may not be available in another. Using an SDK the developer may target a particular operating system and take advantage of its specific capabilities to create an application with those features. Such applications are called native applications or native apps and they guarantee the best usability, the best features, and the best overall mobile experience. But this native development approach by using SDKs has its own drawbacks. These SDKs are tied to the specific platforms and primarily use different programming languages like Objective-C for iOS, Java for Android, and C # for Windows Phone, Java for BlackBerry OS, C++ for Symbian, etc. The developed native applications are not portable to other platforms meaning that one has to almost entirely rewrite the application all over again for any other targeted platform. The Figure 1.1 gives a better picture regarding the native development.
Figure 1.1: Sampling of the mobile platforms and their various programming languages and devices.
The figure shows a sampling of six different mobile platforms and their various programming languages and devices. So in the native approach in order to target different platforms, the developer needs to have different skill sets and familiarity with different platforms. Apart from that, developing an application for each platform individually will escalate the time and cost and top it up with the maintenance cost of all those different versions of applications. So there are challenges in developing mobile applications which are interoperable across different platforms using moreover the same codebase.
Today there are so many mobile devices running on different platforms and platform versions, with even bigger number of different displays (differing in screen size, aspect ratio, PPI, resolution and various technology). Therefore, developers need tools that will help them build applications faster while keeping them consistent throughout different devices. The main motivation of this thesis is to completely automate the process of developing cross platform mobile applications by using the Interaction Flow Modeling Language (IFML). With the introduction of IFML, we are moving into the field of Model-Driven Development (MDD), where MDD applications are (semi)automatically generated from the models, allowing for more flexibility, faster prototyping, validation in the early phases of a project and shorter time to market. In this thesis we choose a cross-platform mobile development tool, propose a basic mapping between IFML and the chosen tool, and develop an application generation prototype, followed by a more extensive elaboration on a concrete example. At the end we give conclusion on the advantages and disadvantages of both the tools and the languages used, along with a future work proposition.
1.2 SMARTPHONE MARKET
The three mobile platforms of interest in this thesis are as mentioned before Android, iOS and Windows Phone. However, there are other important platforms on the market that should be mentioned when discussing the smartphone market as a whole, and they are primarily Symbian (by Nokia) and Blackberry (by RIM), as seen in Figure 1.2. These two platforms have historically had large market shares, but were dropping in market shares lately due to strong sales for iOS and Android [20]. It could also be mentioned, that the fifth most popular platform for smartphones is at present Bada manufactured by Samsung.
Figure 1.2: Worldwide smartphone sales grouped by OS, fourth quarter 2011
ANDROID
Google purchased Android Inc. in 2005 and since then developers have been introduced to a numerous of new versions [9]. The open source platform has steadily increased since 2008 and is now the largest smartphone platform worldwide [20]. The Linux based platform has become popular among developers because of the simplicity in allowing third party application to be downloaded and installed from a large variety of app markets [45]. The Android platform is backwards compatible with older versions, which allows developers to create applications for smartphones not running the latest versions and thus so reaching out to more users. Android version 2.2, Froyo, is one of the older versions and 23.1% of the Android users are running it as their smartphone OS. The mostly used Android version is 2.3, Gingerbread, with 63.7% of the Android users [44]. In March 2012, Google launched their new app market, expanding it with music and video downloads, by merging the two predecessors Android Market and Google Music services [34].
IOS
iOS is the mobile operating system developed for Apple’s mobile and tablet devices. The OS was originally released 2007 under the name iPhone OS, but was renamed 2010 to reflect the extended support for other Apple devices such as IPad and Apple TV [35]. Some of the competitors to iOS on the mobile OS scene are Google’s Android OS, Windows Phone 7 and BlackBerry OS. In comparison, the iOS is leading in the area of total app downloads, with over 25 billion downloads [11], compared to its closest contender Android with over 10 billion downloads [7]. Also when it comes to global mobile application stores revenue, the iOS App Store has the highest revenue [40], but that may be due to it only having 28% of free apps, in comparison to Google Play's over 57% of free apps [37]. iOS’s closed and proprietary nature has been criticized from developers to competitors [42] [15]. Some of the issues that have been in focus are the development model (requiring a yearly subscription costing US$99) and the thoroughly review process for distributing apps on App store. However there are other developers that argue that a more closed platform could provide added security [17].
WINDOWS PHONE
Microsoft OS for smartphones, formerly known as Windows Mobile, is the sixth largest operating system, after android, iOS, Symbian, Blackberry and Bada as seen in Figure 1.2. When distributing an app for WP, every application must be approved by Microsoft and has to be available from the Windows Phone Marketplace [31]. The merely two-year-old WP platform has not yet shown impressive sales figures, and it is hard to predict the future for Windows Phone. With Nokia as manufacturer and Windows Phone “Tango” as new OS, some predict the WP devices can target the emerging markets as a Symbian replacement. [34]
1.3 PROBLEM DEFINITION AND PROBLEM STATEMENT
Even though native development approach comes with all the bells and whistles, it has one severe restriction of being tied to a particular platform. This means native approach becomes a very expensive solution especially when looked from the context of fragmentation of the mobile landscape. So there is a need for an approach of mobile development which can address the fragmentation resulting from the different platforms and devices. This obviously and advertently leads to the cross-platform approaches and solutions. The motivation behind this thesis is to explore the cross-platform mobile development as an alternative to native mobile development; how can they be achieved, how can they tackle the aforementioned challenges in mobile development, and what benefits can they bring. So it is envisaged that a literature survey followed by the prototype cross-platform mobile application development will help better understand these questions and the domain in general. To put it succinctly, the work will be aimed at investigating the mobile development approach that leads to cross-platform mobile solutions which can alleviate those mentioned challenges and problems. Hence a research question has been formulated as below for which this thesis work tries to find plausible answer.
• What approaches of mobile development entail to cross-platform mobile applications in the fragmented mobile landscape and what are the potential benefits of such approaches and applications?
To get a better understanding of the problem definition and answer it effectively the above research question is divided into following two sub-questions.
a. What kind of practices and technologies exist and how can they address the issues of developing the applications that can run across different platforms and variety of mobile devices?
b. What are the potential benefits of adopting such practices and technologies to devise solutions in the mobile development?
Applications targeted to iOS and Android platforms are written with completely different languages. Applications targeted for iOS are written in Objective-C while those targeted for Android devices are written in Java. The most obvious difference between platforms is the language with which the applications are written. Additionally, developers should be aware of different hardware capabilities such as external SD cards and forward facing cameras. Finally, each platform has developed individual User Interface (UI) styles that users have become accustomed. Users expect that each application will adhere to the platform standard UI style. This final aspect all but mandates that cross-platform applications maintain separate UIs for each targeted platform.
In order to remain relevant in today’s application marketplaces, developers must embrace cross-platform development concepts to ensure that the applications are targeted to as many different platforms as possible. To that end it becomes necessary that any application developed for one platform also be made available for other existing with the ability to be ported to future platforms.
Each platform consists of separate hardware profiles, including processor and memory, as well as screen size and other options such as cameras and Bluetooth. These hardware profiles cause the platform specific APIs to differ between platforms.
In addition to language and hardware differences, each platform provides unique user interface guidelines with which users have become accustomed and developers are expected to maintain in any application they develop
These factors result in increased costs in terms of time and money spent on the re-design process and the opportunity cost of that development time not being spent addressing new application design, or at the least, maintaining and upgrading the already released application. Additionally, the second design process often results in drastically different code bases that increases maintenance costs and may lead to applications with different features.
1.4 ANALYSIS OF EXISTING FRAMEWORKS
Some basic usability factors should be defined before comparing frameworks, because choosing a good framework influences the final application usability tremendously.
Many factors contribute to the decision: whether users will use an app, including design, reliability, performance and overall good usability. Users expect that the mobile application makes contextually-relevant information instantly accessible and it should deliver this content promptly and intuitively. Applications that do not fulfill this requirement might get uninstalled quickly.
Here are some of the basic application design guidelines: The developer should use standard native interface controls to conform to each platform design conventions and vendor’s guidelines, so users can quickly adapt to an interface. The app should also offer optimal performance using platform-level acceleration and have full access to underlying platform/device functionality.
1.5 NATIVE TOOLS
The most common technique used today for creating mobile apps for multiple mobile device platforms is writing the app from scratch for each vendor. Apple iOS applications are very fast, but usually developers are stumbling with Objective-C concepts such as pointers and difficult debugging, which differs heavily from high-level languages. Therefore, Apple created Swift language [9] that adopts more high-level concepts from C# and Java. Apple also provides Xcode [10], an integrated development environment (IDE), a suite of development tools for creating software also for iOS. It contains built-in Interface Builder for constructing graphical user interfaces.
Until version 4.4, Android used Dalvik [11] — a process virtual machine3 to run apps. Dalvik was using a just-in-time compilation of Java bytecode. This late compilation contributed to inadequate performance. In Android 4.4, a new ART (Android Runtime) environment was introduced. ART used new ahead-of-time compilation (during installation) of apps allowing faster runtime. It became the only runtime option in Android 5. Android Studio is an IDE for developing on the Android platform; it contains a WYSIWYG4 editor for real-time app rendering.
Android always used re-implemented Java libraries. From my point of view, the biggest drawback is that “Android Java” is always an about two-years-old subset/implementation of standard Oracle Java libraries.
Microsoft’s Windows Phone .NET usually has a faster development cycle than Android, because it uses .NET natively. For example, the new version of C# 6 compiler can be used on mobile devices the day it was introduced for the .NET stack. Windows Phone apps are based on XNA, a Windows Phone specific version of Silverlight [12], the Windows Phone App Studio [13], or the Windows Runtime [14]. These technologies allow developers to develop apps simultaneously for Windows Store (desktop and tablet Windows) and for Windows Phone. Apps are usually designed and tested in Microsoft’s Visual Studio.
Although each platform vendor provides free tools for mobile development, some (usually small) payments are required for a platform developer license (to allow publishing of the app). A summary of native tools is described in Table 1.1.
Table 1.1: Summary of native mobile tools
Platform iOS Android Windows Phone
Runtime machine code Dalvik/ART .NET
Tools • Objective-C
• Swift • Java
• Android XML • C#
• C++
• XAML
• HTML5
1.5.1 STRENGTHS AND WEAKNESSES OF NATIVE DEVELOPMENT
Because native apps run on platforms designed for them, there are usually no performance problems caused by the framework. Native solutions also have a large community and tools for development are very mature. On the other hand, there is a need for high platform dependent knowledge, and the biggest drawback is that the developer cannot reuse any code at all (including business logic). A partial solution that is usually used is moving most of the business logic on a web server as most apps today need some online backend anyway. But this impacts the performance profoundly.
1.6 APACHE CORDOVA
Cordova (previously named PhoneGap) [15] is an open source hybrid5 mobile application framework that uses a native wrapper to run interpreted HTML5/CSS3/JavaScript code. Access to particular system resources is granted through platform-specific wrappers included in Cordova. The resulting application is hybrid, meaning that it is partially native and partially displayed in the application’s web view (as shown in Figure 1.2). JavaScript notifies the browser using an asynchronous call, and the browser calls internal commands; then it can return requested information in a JS callback6
Figure 1.3: Apache Cordova architecture
The framework can be extended with native plug-ins allowing developers to add functionality called from JavaScript. HTML5 now provides access to hardware. However, browser support for HTML5 based device access is not consistent across mobile browsers. To overcome these limitations, the framework embeds HTML5 support into an in-app web browser (independent of a device browser). Table 2 summarizes framework behavior on different platforms.
At least two existing frameworks use this open source solution: Adobe’s PhoneGap [17] and Visual Studio Tools for Apache Cordova [18]. PhoneGap is a productized version and a complete ecosystem built on top of Cordoba. VS Tools adds an installer for SDK, tools and libraries and also build and debug tools. It also has a library for integrating the app into MS Azure7 cloud backend, Microsoft Azure Mobile App Services [19].
Table 1.2: Summary of Apache Cordova framework tools
Platform iOS Android Windows Phone
Runtime Cordova
(iOS wrapper) Cordova
(Android wrapper) Cordova
(WP wrapper)
Tools • HTML5/JavaScript
1.6.1 STRENGTHS AND WEAKNESSES OF APACHE CORDOVA
The most obvious advantage of this framework is no need for emulators at early stages of development. This benefit simplifies the presentation of demos and makes progress faster as it eliminates deployment on an emulator (the app can be run in a regular browser). Also, it is free and open source; no initial investments are needed. No particular platform knowledge is required, just HTML5 and JavaScript (at least at the beginning).
However, there is no guarantee that application development will be successful. Adobe Systems warns that apps built using PhoneGap/Cordoba might be rejected by Apple for poor performance and “exotic” look [20]. JavaScript is not compiled, so the developer cannot benefit from compile time errors. JavaScript has a poor performance and touch delay with limited mobile device resources. Apps that need offline mode might be hard to create, as they need a native plugin for every platform. Until today, some hardware wrappers implementations are still missing or incomplete. There is a very clear chance that companies will need to pay for the commercial solution anyway, because some parts of the framework are not yet implemented, or for performance reasons.
1.6.2 PERFORMANCE OF APACHE CORDOVA
Native performance is hard to achieve with frameworks that interpret code in runtime. Applications written in Cordova have a long loading time, poor performance, and they are almost unusable with highly CPU-bound work. The good thing is that the application package size is considerably smaller than Xamarin apps [21].
In 2013, high profile companies such as LinkedIn and Facebook abandoned HTML5 mobile apps, with Mark Zuckerberg saying: “Betting completely on HTML5 is one of the, if not THE biggest strategic mistake we’ve made” [22]. Now they both use native solutions.
1.7 XAMARIN
The Xamarin Platform [23] has two parts. It consists of Xamarin. Android (formerly known as MonoDroid) and Xamarin.iOS (or MonoTouch). Development resembles native development using native tools. But because it uses C#, the developer is allowed to reuse business logic and backend between platforms.
Xamarin basically wraps iOS, OSX, Android, and Windows Phone platforms to create a unified way of accessing them through .NET (as shown in Table 1.3). This architecture can be a very complex problem because underlying technologies evolve and change quite frequently. For example when iOS introduced 64bit support Xamarin needed one year to compensate this. This quick development resulted in a lot of bugs that might frustrate end-developers [24].
Table 1.3: Summary of the Xamarin framework
Platform iOS Android Windows Phone
Runtime ARM assembly code native assembly Windows Phone .NET
Tools • C# / XAML
In 2014, Xamarin released a new technology called Xamarin. Forms which allows more code reusability because of using the same UI code for all platforms. The biggest weakness is a missing UI designer for Xamarin. Forms.
The overview in Figure 1.2 displays a few building blocks: Xamarin supports both Visual Studio (not in cheaper versions) and Xamarin Studio IDE. Xamarin Studio is the only option with cheaper licenses of Xamarin, and it does not have as many features as Visual Studio and also it is not compatible with VS extensions such as ReSharper. However, Xamarin Studio can run on Mac computers (which is not possible for Visual Studio).
Both IDEs support pre-build components from Xamarin Component Store. This store is not as good as Visual Studio NuGet because it doesn’t support automatic updates of packages. But thanks to the open source community, the packaging system NuGet quickly compensated and most of the components are also available through NuGet.