Development of cross-platform mobile applications using web content inside a native wrapper. Bc. Tomáö Mi iak - PDF

Description
M F U I Development of cross-platform mobile applications using web content inside a native wrapper M T Bc. Tomáö Mi iak Brno, Fall 2016 Declaration Hereby I declare that this paper is my original authorial

Please download to get full document.

View again

of 57
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

Entertainment

Publish on:

Views: 19 | Pages: 57

Extension: PDF | Download: 0

Share
Transcript
M F U I Development of cross-platform mobile applications using web content inside a native wrapper M T Bc. Tomáö Mi iak Brno, Fall 2016 Declaration Hereby I declare that this paper is my original authorial work, which I have worked out by 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. Tomáö Mi iak Advisor: Ing. RNDr. Barbora Bühnová Ph.D. i Acknowledgement I would like to express my gratitude to the supervisor of my thesis Ing. RNRr. Barbora Bühnová, Ph.D. for her valued advice, insinghts and help throughout my work on this thesis. Next I would like to thank my consultant Mgr. Vanda Cabanová for providing me the opportunity to work on this topic and for listening and helping me with all the disputes I have had along the way. Last but not least I would like to express my love and appreciation for my parents, who have supported me both emotionally and financially during all the long six and a half years of my studies. ii Abstract The goal of this thesis is to analyze options for mobile application development and implement a prototype using a selected approach. The thesis puts an emphasis on avoiding dogmatism in technology selection process by studying the specific conditions and requirements of the given project. The proposed approach is therefore created specifically for the given project case. It is based on reusing HTML views generated for a web application inside thin mobile client applications. As a consequence the implementation of these clients is very light. Even though there are some obstacles that need to be solved, applying the approach is deemed to be helpful in this specific project. iii Keywords market research, prototype development, mobile application, crossplatform, hybrid, mobile web, ios, Android, Rails iv Contents 1 Introduction Mobile market Mobile is outgrowing desktop Application markets Trends in mobile platforms Mobile application development Growing complexity Development approaches Avoiding dogmatism Case description Prototype description Options evaluation Custom approach Solution design and implementation Used technologies Rendering correct views for each platform Mobile client applications structure Javascript - native code communication User authentication O ine functionality Improving load times Evaluation Benefits Caveats Summary Conclusion Bibliography A List of electronic attachments B Installation C Mobile platform shares data v 1 Introduction Over the last decade mobile technologies progressed immensely and mobile market went through a very turbulent phase that brought a lot of changes. It is thus important for software developers not to stubbornly keep to their previous assumptions, technologies and development approaches without studying the situation in context of their current mobile application projects. The motivation behind this master thesis is doing this analysis and research as a part of a project for a small non-profit organization. Besides the assessment of the situation the output of this thesis is a mobile application prototype created with the most appropriate approach for the project s case. The thesis is divided into five chapters. The first chapter takes a look at the history, current trends and possible future prospects of the mobile markets. The second chapter links these findings to a research about the di culties and approaches in modern mobile development. The second part of this thesis presents the project and its specific conditions. These are taken into account in the design of a prototype and its requirements. A discussion is held about which of the development approaches are suitable for this case. A custom approach that builds upon the specifics of the case is proposed and described. The last part of the thesis explains the design and implementation of the prototype build using the proposed approach. In the end the findings discovered during the implementation are evaluated in context of the projects specifics, and the benefits and caveats are discussed. 1 2 Mobile market 2.1 Mobile is outgrowing desktop It was only eight years ago that the first iphone was introduced. Since then the entire market of personal computation has undergone a great transformation. Worldwide smart phone sales have already surpassed personal computers sales in 2011 by 28 millions of units [1]. Since then the gap is only getting wider. In 2014 personal computer sales reached 313 millions of units compared to billion of mobile phone sales [2]. The increasing interest in mobile devices is also reflected in the amount of time we spend using them. According to comscore, 1 media consumption in U.S. grew by 394% on smartphones and by 1,721% on tablet devices between years 2010 and 2014 [3]. Social networking is also transferring to mobile. In their quarterly earnings report for the third quarter of 2015 Facebook announced that almost half of their millions of their monthly users are mobile-only [4]. 2.2 Application markets Most of the mobile applications are being sold though the o cial channels of the platform vendors - the app markets. These markets o er a relatively easy way of distributing applications to all the smart device owners. This fact together with the popularity of mobile devices have attracted many developers and triggered new interest in software development. In July 2015 there were 1.5 million applications available on the Apple s AppStore [5] and 1.6 million in Google Play Store [6]. And the number of applications available on these two most popular markets is growing by roughly a thousand each day. Such a high saturation of applications on these markets is rising the competitiveness between the mobile developers. In every application category on the market, there are always multiple top applications with very similar functionality fighting over the customers, and a dozen more that are just waiting to be discovered. 1. comscore is a global media measurement and analytics company 2 2.3 Trends in mobile platforms. M Even though over the past years the mobile market itself has been growing steadily, its structure has completely changed. Apple s success with iphone motivated other companies to create their own mobile operating systems and smart devices [7]. At the peak of this mobile gold rush in years 2010 and 2011 there were many operating systems available - ios, Android, Windows Phone, BlackBerry, Firefox OS, Tizen, Bada, webos, MeeGo and several others. However most of these have never become widely popular. Besides ios only Android operating system achieved a mass success and is currently the most used mobile operating system worldwide. Not only the newly created mobile platforms have not succeeded, many previously very popular mobile operating systems and vendors have not survived this market transformation, as their customers moved either to ios or Android. For example the most popular mobile manufacturer of the previous decade Nokia, sold its mobile division to Microsoft in 2014, which was the end to its operating system Symbian. Another company that is at the edge of oblivion is RIM, the company behind the BlackBerry smartphones. They held more than 20% of the market share in the third quarter of 2009 to fell to only 0.3% in the third quarter of According to the statistical data from Gartner 2 other mentioned platforms are currently either canceled or make up for only a very tiny part of the whole market. So it seems that the mobile wars are now over with two clear winners, Apple s ios and Google s Android, as in the third quarter of 2015 they hold almost 98% of combined market shares. The only other competitor that still holds more than a percent of the shares is Microsoft with 1.7%. However this is still the worst result for their Windows Phone operating system since the year The evolution of the mobile platform market shares between the third quarter of 2009 and the third quarter of 2015 is captured in the chart 2.1. Data for this chart can be found in the appendix C Gartner is a information technology market research and advisory company based in USA. 3 . M Figure 2.1: Mobile platform market share 3 Mobile application development 3.1 Growing complexity One of the factors in the success of a project is the selection of the right development tools. It may seem that this is not as important for mobile applications, since they run on small devices and have only a few screens. Although the statement could have been considered true a few years back, it gets less true with every year, as mobile applications get closer in complexity to their desktop counterparts. The main catalyst for this course is the saturation, growth and competitiveness in the mobile market that ignites progress and innovation 2.1. Device manufacturers compete in bringing the biggest technological advancements. As a part of this, the computational power of mobile devices is quickly increasing. The most powerful ios device in 2015 is 21x more powerful than the most powerful device in 2009 [8]. Every year platform vendors expand their mobile SDKs with numerous new APIs and frameworks that make use of this new computational power. For example on ios the number of SDK elements grew from around 2,500 in 2008 to almost 13,000 in [9]. However not even this mass of APIs is enough to cover all the needs of a modern mobile application. To gain a competitive edge, developers also use another set of tools and technologies that support the sales and maintenance of the application. These tools serve various functions: Analysis of the application s user base. Tracking of events, either generated by the user or the application itself. Crash recording, gathering and reporting. Providing users with a way of sending meaningful feedback to the developers Monetization via advertisements or in-app purchases 1 1. In-app purchasing is monetization technique. It refers to the ability of a mobile device to facilitate the sale of products or services within a specific application or app . [10] 5 . M Boosting sales by promoting application Improving discoverability by implementing mobile deep-links 2 from other applications or web sites 3.2 Development approaches As was mentioned in the previous chapter, in the past years a huge new market of mobile devices was born. With it came new opportunities for software companies 2.2. However there was also one negative aspect - segmentation of the market 2.3, which have had an e ect similar to the browser wars 3. Mobile application developers were left with a tough decision of which platforms to prioritize and support in order to get their application to most of all the possible customers while keeping the development costs and complexity on an acceptable level. To help with this issue various frameworks, tools and strategies were created that enabled cross-platform development, or at least reduced the cost of transferring application code between platforms. Development teams therefore have to choose not only the platform for which they will develop their application, but also tools and technologies with which to implement the application. Since used technology is crucial to the success of the project 3.1 it is important to know the di erences between these approaches. This section describes three major approaches to mobile application development. Each one is based on a di erent ideology, has its own advantages and disadvantages and so is suitable for achieving di erent goals. In each group, there are many similar tools. The main di erence that ties them into one of these three group is whether the resulting application is capable of supporting multiple platforms and the way this is achieved. [13] 2. Deeplinking is a methodology for launching a native mobile application via a link. Deeplinking connects a unique url to a defined action in a mobile app, seamlessly linking users to relevant content. [11] 3. Era of the Internet where multiple web browsers coexisted, each having a slightly di erent support and introducing their own standards for web technologies like HTML, CSS and Javascript. As a result it was very complicated for web developers to optimize their code for each browser. [12] 6 . M Native The basic approach is to use the tools and technologies provided by the platform vendors. Mobile platforms di er in their inner implementation, user interface, interaction concepts, operating system they run on and various other aspects. These di erences are also translated into the development environments of each platform. They have di erent constraints, use di erent main programming languages, libraries, frameworks and design patterns. Every platform has also its own IDE that usually supports development only for this single platform. ios Android Windows Phone IDE XCode Android Studio Programming language Prominent software design patterns Database Objective-C, Swift Singleton, Key-Value Observing, Delegation Core Data - an object graph persistence library Java C# Adapter, ViewHolder ORM libraries -ormlite, ormdroid Visual Studio Model View View-Model LINQ As a negative consequence applications, their source code, as well as the knowledge of one platform is not easily transferable to another. This makes it quite expensive and time consuming to create and support applications across multiple platforms. On the other hand each application is optimized, may use all the features of its platform and its development is very streamlined thanks to specialized tools. Cross-platform The main selling point of these tools is the ability to write a single source code that can be compiled for platforms. They can be generally divided into two groups. 7 . M First group consists of tools that provide access to the native UI components of the application. They either transform or compile source code of the application into native programming code or machine code of the platform. Talking in the MVC terminology, these tools usually enable to share model and controller code between the platforms. However since they are built on top of the native libraries, view code has to be written separately for every platform. Sometimes developers have to resort to writing code in native programming language, when some functionality is not available through the tool. Produced applications act, feel and perform very close to native applications. These tools are definitely worth taking a closer look when creating a standard applications. The most popular and used are Xamarin and RubyMotion. Very promising is also recently introduced ReactNative developed and used in Facebook. In the second group there are tools that do not try to provide native interface in the produced applications. They are used mainly for creating games and media applications and their drawing engines are usually based on OpenGL. Similarly to the previous group code of the application is written in single programming language and then compiled for multiple platforms. Even though these tools are very capable and popular, they are not as useful for building applications like the one that is focus of this thesis. For these reason I do not cover them in more detail. Among the most used tools in this group are Unity, Cocos2D-X or Corona. Hybrid Hybrid solutions combine web content embedded inside native web view component, which serves as a bridge between Javascript inside the web page and native libraries of the platform. Some device capabilities are supported directly by the web view e.g. touch event handling. For other functionality to work, developers must implement an interface through which to pass data from native code to Javascript. This interface is what most hybrid frameworks aim to handle and abstract for the application developer [14]. In general performance of the resulting application cannot compare to the previous two approaches since it is for a most part just an embedded web page [15]. However devices are getting more powerful 3.1, so this issue is becoming less 8 . M important. Also web technologies progressed a lot in the recent years and it were advancements like HTML5 that enabled creation of these tools. 9 4 Avoiding dogmatism The previous chapter mentions the need of choosing the right development tools and technologies. It also describes the most common approaches to mobile application development and lists most popular technologies. With all these possible solutions it may be di cult to answer the question of which approach and technology is the best or the most suitable for a specific project. Many developers have already been asking this question. It is actually the reason why most of these tools were created. Through them their developers are trying to provide a possible answer, and thus unintentionally they make the decision process that much harder for other developers. However on the other hand a broader selection means a possibly better fit for the specific application. Which in the end is probably a good thing, since every project is di erent, has di erent set of constraints, goals and needs and therefore needs a di erent approach. These conditions of the project can be used as factors in the selection process of the most appropriate technologies and tools to use by limiting the choices. And because not a single one can be considered as the best option for all the cases, it is favorable to adjust the factors for each new project. We can define three scopes for these factors. Technological factors include the type of the application (game, media or standard), performance dependency, supported platforms, ease of maintenance security as well as dependence on other used technologies. Next scope of factors takes into account the development team, mainly its size and experience with the given technology. The last scope contains project-related factors like target audience, deadline or budget. Evaluation of these factors have already been done before. Various studies researched di erences between the available technologies and compared their strengths and weaknesses [14] [15] [16]. Outcome of the most of these studies were recommendation of technologies for various types of applications and project settings. However it is not enough to take one of such studies and apply its findings to the project at hand. These technologies evolve with a rapid pace, so time is also an important factor here. Our view of the technologies, tools, paradigms and development approaches should not be static. They 10 . A change, mature and we also create new ones. Therefore what was true a year ago might not be true anymore. Most of the studies that research cross-platform mobile application development were done during the expansion of the mobile market, when many new mobile platforms were being created. And since as was explained in the section 2.3 mobile platform market has changed to a great extent their findings may not be entirely relevant anymore. This chapter tries evaluate development approaches listed in the section 3.2. The evaluation is done for a specific case described in the following section and in a context of the market conditions mentioned in the chapter Case description The research and work done in this thesis is applied to a specific case of mobile application development. This research is part of a project by a small non-profit organization. Its goal is to design and implement mobile client for their information system. I was hired to work on this project as a sole developer. I was also given a free hand in the approach that I would take and how I would implement these applications. To guide the analysis and design process I have established a set of conditions and constraints of the project. My main concern was choosing an approach that would enable me to complete the job without any major delays. This was very important to me since I am knowledgeable in development for only a single mobi
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks