Mobile Developer's Guide to the Galaxy
Total Page:16
File Type:pdf, Size:1020Kb
an initiative by Don’t Panic MOBILE DEVELOPER’S GUIDE TO THE GALAXY www.enough.de sponsored by msdn.microsoft.com developers.sap.com hp.com/go/mobile „If you want to start your own business in the mobile environment, this is the book you must read rst.“ Minh Nguyen on amazon.com „The title is grand, but the content does live up to the title to an extent. This ebook is a wide-ranging look at almost anything related to mobile app development out there.“ Azzief Khaliq on hongkiat.com „A spectacular piece of work! You will be astonished by how incredibly fast you can establish your presence in the mobile market with the simple steps explained in this guide.“ Daniel Hudson on webtechman.com ly upd te ate le d „A must-read for everyone considering creating and marketing apps.“ p Steve on amazon.com m o c Distribution Partner: E S E T R IL F wip.org L FOR www.mobiledevelopersguide.com published by: Services and Tools for All Mobile Platforms Enough Software GmbH + Co. KG Stavendamm 22 28195 Bremen Germany www.enough.de 15th Edition February 2015 This Developer Guide is licensed under the Creative Commons Some Rights Reserved License. Please send your feedback, questions or sponsorship requests to: [email protected] Follow us on Twitter: @MobileDevGuide Art Direction and Design by Cornelius Kwietniak (Enough Software) Editors: Marco Tabor (Enough Software) Julian Harty www.mobiledevelopersguide.com 1 Mobile Developer’s Guide Contents 1 Prologue 4 The Galaxy of Mobile: An Introduction by Robert Virkus & Marco Tabor 16 From Idea To Concept by Sebastian Meyer 26 User Experience & Interface Design by Anna Alfut 36 Android by Andre Schmidt & Tim Messerschmidt 52 BlackBerry 10 by Marcus Ross 62 Firefox OS by Marcus Ross 68 iOS by John Gambrell 82 Java ME (J2ME) by Ovidiu Iliescu 92 Tizen by Marco Büttner & Patrick Mortara 98 Windows by Robert Virkus 108 Going Cross-Platform by Robert Virkus & Michael Koch 124 Mobile Sites & Web Technologies by Daniel Kranz 138 Enterprise Apps by Ian Thain & Davoc Bradley 146 Mobile Gaming by Oscar Clark 164 Mobile Development & the Internet of Things by Alex Jonsson 172 Programming Smartwatches by Robert Virkus 180 Mobile Analytics by Julian Harty 192 Application Security by Dean Churchill 204 Accessibility by Sally Cain 224 Testing by Julian Harty & Marc van’t Veer 246 Monetization by Michel Shuqair & Carlo Longino 262 Epilogue 263 About the Authors 3 4 5 Prologue App development has gone a long way in the last 10 years. When we started Enough Software in 2005, mobile apps were really quite exotic, limited to phones; and distribution was difficult, to say the least. Now we not only target phones as app developers, we have broadened our reach to support tablets, phablets, PCs, smartwatches, TV systems and Automo- tive systems. Also many Internet of Things (IoT) products come to life thanks to apps. In this 15th edition, since 2009, we reflect these new opportunities in our new chapters; most notably the IoT and the smartwatch chapters. But also all the other chapters have been extended, improved and sometimes even completely revamped. At this point we would like to thank all of our authors - you are doing a great job! We also love our sponsors who make it possible to print this booklet: SAP, HP and Microsoft! Please visit their mobile platform offerings at developers.sap.com, developers.hp.com and dev.windows.com! Please share your excitement with us via twitter @enoughsoftware or via email: [email protected]. And visit mobiledevelopersguide.com to obtain the electronic edition of this booklet, which is available in several languages. Robert + Marco / Enough Software Bremen, February 2015 PS: Want us to help you succeed in the mobile ecosystem? Drop us a line at [email protected] to learn more about our app coaching services. 1 Prologue 2 Prologue th 10EDITION The Galaxy of Mobile: An Introduction Welcome to the world of mobile development, a world where former giants stumble and new stars are seemingly born on a regular basis. The focus of this book is on developing mobile apps, which encompasses a number of phases including: planning and specification, prototyping and design, implementation, internal testing and deployment, deployment to an app store, discovery by users, installation, use and feedback. Ultimately, we want our users to enjoy using our apps and to give us positive ratings to encourage other users to do likewise. Keep reading to learn how to develop apps for the major platforms. Should this be the first time that you have consid- ered getting involved, don't delay; the world is moving rapidly towards mobile becoming the predominant form of computing and others will surely overtake you if you wait too long. While developing mobile apps shares many common feature with developing other software, it has specific characteristics. We will cover some of these next. Topology: Form Factors and Use Patterns Traditionally we app developers only targeted phones. Then tablets followed, and today our apps can span across a complete range of device types: smartwatch, phone, tablet, PC, TV and automotive. Other form factors might follow. Each form factor poses its own usability challenges; for instance, a tablet demands different navigation to a phone, input on TV systems can be cumbersome, and so on. 4 The Galaxy of Mobile: An Introduction Use patterns in an Android app, of course, differ from those on iOS, which also differ from those for Windows Phone apps, et cetera. You should, therefore, refrain from providing an identical experience on all form factors or even all you target are smartphones. Otherwise, you risk delivering a mediocre service to various sections of your target user base. Star Formation: Creating a Mobile Service There are several ways to realize a mobile service: — App — Website — SMS, USSD1 and STK2 App Apps run directly on the device. You can realize them as native, web-based or hybrid apps. Native Apps A native app is programmed in a platform specific language with platform specific APIs. It is typically purchased, down- loaded and upgraded through the platform specific central app store. Native apps usually offer the best performance, the deep- est integration and the best overall user experience compared to other options. However, native development is often also the most complex development option. 1 en.wikipedia.org/wiki/USSD 2 en.wikipedia.org/wiki/SIM_Application_Toolkit 5 The Galaxy of Mobile: An Introduction Web Apps A web app is based on HTML5, JavaScript and CSS and does not rely on any app store. It is a locally stored mobile site that tries to emulate the look-and-feel of an app. A famous example of a web app is the Financial Times app, which left the app store in order to keep all subscriber revenue to themselves for the web world; conversely, the web-based Facebook iOS app was revamped into native app in order to dramatically improve its performance and usability. There are several web app frameworks available to build a native wrapper around such apps so that you can publish them in app stores, such as Phonegap3. Hybrid Apps A hyped controversy circles around whether native or web apps are the future. For many mobile app developers, this controversy is no longer relevant as a hybrid approach to app development has become quite common: an app can use native code for enhanced performance and integration of the app with the platform, while using a webview together with HTML5-based content for other parts of the app. Parts of the resulting app behave like a native app, while other parts are powered by web technologies. The web-based part can use Internet connectiv- ity to offer up-to-date content. While this could be viewed as a drawback, the use of web technologies enables developers to revise content and features without the need to submit updates to app stores. The key challenge is to combine the unique capabilities of native and web technologies to create a truly user-friendly and attractive app. 3 www.phonegap.com The Galaxy of Mobile: An Introduction 6 Website A website runs on your server but you can access various phone features on the device with JavaScript, for example to store data locally or to request the current location of the device. In contrast to apps, mobile websites are inherently cross-platform. Historically mobile websites often catered for WebKit based browsers such as the Mobile Safari. Nowadays, WebKit and Chromium are the dominant mobile rendering engines with Internet Explorer's Trident engine and others fol- low behind in the mobile space. For the sake of an open web, aim to use HTML5 standards as much as possible and refrain from rendering engine-specific code. SMS, USSD and STK Simple services can be realized with SMS, USSD or STK. Every- one knows how SMS (Short Message Service) text messaging works and every phone supports SMS, but you need to convince your users to remember textual commands for more complex services. Some operators offer APIs for messaging services that work for WiFi-only devices, such as the network APIs of Deutsche Telekom4. In the UK in many towns parking charges can be paid using SMS messages. USSD (Unstructured Supplementary Service Data) is a GSM protocol used for pushing simple text based menus, the capabilities depend on the carrier and the device. In Sri Lanka, visitors can receive a free SIM card which is registered using USSD menus. STK (SIM Application Toolkit) enables the implementation of low-level, interactive apps directly on the SIM card of a phone. STK may appear irrelevant when so much focus is on smartphone apps; however, for example, m-pesa is an STK app 4 www.developergarden.com/apis 7 which is transforming life and financial transactions in Kenya and other countries.5 The Universe of Mobile Operating Systems The mobile space is much more diverse than other areas in IT.