Native Applications on Modern Devices Master's Thesis
Total Page:16
File Type:pdf, Size:1020Kb
Native applications on modern devices Master's thesis Simen Hasselknippe 4/22/2014 This page is intentionally left blank DEVELOPING NATIVE APPLICATIONS ON MODERN DEVICES: A CROSS-PLATFORM APPROACH A Xamarin product research Keywords Xamarin, MvvmCross, MonoGame, Mono, Native, App, App-development, C#, devices, cross- platform, iOS, Android, Windows Phone, Windows 8 Simen Hasselknippe [email protected] This page is intentionally left blank Abstract This paper is a part of my master thesis at the University of Oslo. It introduces concepts, theories, and patterns related to cross-platform development on mobile devices. It discusses what applications programmers can develop, what devices are important to target, and how to develop mobile applications with a cross-platform approach. During this thesis, I have used various tools and products, including Xamarin.iOS, Xamarin.Android Xamarin Studio, Visual Studio, MvvmCross, MonoGame, iOS, Android and Windows Phone. This page is intentionally left blank Table of Contents Preface............................................................................................................................................. 7 List of figures .................................................................................................................................. 9 List of tables .................................................................................................................................. 11 Introduction ................................................................................................................................... 13 1 Background material .......................................................................................................... 17 1.1 The history of cross-platform development ................................................................... 17 1.2 Modern devices .............................................................................................................. 19 1.3 Devices are a big deal..................................................................................................... 20 1.4 Modern applications ....................................................................................................... 21 1.5 Application packages ..................................................................................................... 25 1.6 Application lifecycle ...................................................................................................... 26 1.7 Game lifecycle................................................................................................................ 28 1.8 Interaction-based taxonomy of mobile applications ...................................................... 30 1.9 Application Types .......................................................................................................... 30 1.10 Research question ........................................................................................................... 33 2 General discussion ............................................................................................................. 35 2.1 Feature based taxonomy of mobile applications ............................................................ 35 2.2 Types of tools to enrich mobile development ................................................................ 36 2.3 Code-sharing strategies .................................................................................................. 50 2.4 Cross-platform architecture ............................................................................................ 54 3 Experiments ....................................................................................................................... 57 3.1 Experiment 1 – LittleWishList ....................................................................................... 58 3.2 Experiment 2 – Quizter .................................................................................................. 72 3.3 Experiment 3 – MovieSeeker ......................................................................................... 80 3.4 Experiment 4 – Brickasa ................................................................................................ 82 3.5 Experiment 5 – PropertyCross ....................................................................................... 89 4 Analysis.............................................................................................................................. 95 4.1 Tools ............................................................................................................................... 95 4.2 Native look and feel ....................................................................................................... 96 4.3 Architecture .................................................................................................................... 97 4.4 Ecosystem....................................................................................................................... 98 4.5 Code sharing strategies................................................................................................. 100 4.6 Sharable code ............................................................................................................... 101 4.7 Development ................................................................................................................ 102 4.8 Features ........................................................................................................................ 103 4.9 Limitations ................................................................................................................... 104 5 Further work..................................................................................................................... 105 6 Conclusion ....................................................................................................................... 107 7 Looking back ................................................................................................................... 109 8 Appendix .......................................................................................................................... 111 8.1 Screenshots ................................................................................................................... 111 8.2 Code ............................................................................................................................. 115 9 References ........................................................................................................................ 117 Preface Developing applications is both challenging and fun. I choose this topic because I am interested in developing applications on many platforms. I wanted to learn about methods, architectures and tools that could remove some of the pain related to app development. This paper is intended to educate in application development as well as provide a good overview of applications and devices. I started my work by defining a few research questions. These questions were divided into theories. I then started planned experiments to check if they were valid. As time has passed, the experiments have led to more theories, which required a periodic re-evaluation of the research questions to keep them updated and in-line with path of the research. Special thanks go to both of my supervisors—Dag Langmyhr at the University of Oslo, who has given me great advice in terms of spelling, content and information, and Tomas Jansson at Bekk Consulting AS, who has given the perfect combination of editing and technical assistance. Finally, big thanks to my family for endless encouragement and support through all my years of studies. 7 This page is intentionally left blank 8 List of figures Figure 1 - Web application running on iPhone, Android, and Windows Phone ..................... 17 Figure 2 - iOS lifecycle ............................................................................................................ 26 Figure 3 - Game loop ............................................................................................................... 28 Figure 4 - jQuery mobile theme roller ..................................................................................... 37 Figure 5 - Dojo toolkit demo ................................................................................................... 38 Figure 6 - Kendo UI on iOS, Android and Windows Phone ................................................... 39 Figure 7 - Topcoat list view ..................................................................................................... 39 Figure 8 - PhoneGap project running in visual studio ............................................................. 41 Figure 9 - Telerik AppBuilder ide ........................................................................................... 42 Figure 10 - Xamarin project Structure for file linking ............................................................. 50 Figure 11 - Add linked file in Visual studio ............................................................................ 51 Figure 12 - Add linked file in Xamarin studio ......................................................................... 51 Figure 13 - Linked file Visual Studio ...................................................................................... 52 Figure 14 - Portable class library ............................................................................................