Mobile Developer's Guide to the Galaxy
Total Page:16
File Type:pdf, Size:1020Kb
Don’t Panic MOBILE DEVELOPER’S GUIDE TO THE GALAXY U PD A TE D & EX TE ND 12th ED EDITION published by: Services and Tools for All Mobile Platforms Enough Software GmbH + Co. KG Sögestrasse 70 28195 Bremen Germany www.enough.de Please send your feedback, questions or sponsorship requests to: [email protected] Follow us on Twitter: @enoughsoftware 12th Edition February 2013 This Developer Guide is licensed under the Creative Commons Some Rights Reserved License. Editors: Marco Tabor (Enough Software) Julian Harty Izabella Balce Art Direction and Design by Andrej Balaz (Enough Software) Mobile Developer’s Guide Contents I Prologue 1 The Galaxy of Mobile: An Introduction 1 Topology: Form Factors and Usage Patterns 2 Star Formation: Creating a Mobile Service 6 The Universe of Mobile Operating Systems 12 About Time and Space 12 Lost in Space 14 Conceptional Design For Mobile 14 Capturing The Idea 16 Designing User Experience 22 Android 22 The Ecosystem 24 Prerequisites 25 Implementation 28 Testing 30 Building 30 Signing 31 Distribution 32 Monetization 34 BlackBerry Java Apps 34 The Ecosystem 35 Prerequisites 36 Implementation 38 Testing 39 Signing 39 Distribution 40 Learn More 42 BlackBerry 10 42 The Ecosystem 43 Development 51 Testing 51 Signing 52 Distribution 54 iOS 54 The Ecosystem 55 Technology Overview 57 Testing & Debugging 59 Learn More 62 Java ME (J2ME) 62 The Ecosystem 63 Prerequisites 64 Implementation 67 Testing 68 Porting 70 Signing 71 Distribution 72 Learn More 4 75 Windows Phone 75 The Ecosystem 76 Implementation 82 Testing And Analytics 82 Distribution 84 Learn More 86 Windows 8 86 Prerequisites 87 Implementation 92 Distribution 93 Learn More 95 Going Cross-Platform 95 Key Differences Between Mobile Platforms 100 Cross-Platform Strategies 104 Cross-Platform App Frameworks 109 Cross-Platform Game Engines 112 Web Technologies 114 HTML5 115 Fragmentation Needs Adapation 119 Testing Web Technologies 121 Learn More 123 Accessibility 125 Accessible Android Apps 126 Accessible BlackBerry Apps 126 Accessible iOS Apps 127 Accessible Symbian / Qt Apps 127 Accessible Windows Phone & Windows 8 Apps 128 Accessible Mobile Web Apps 130 Enterprise Apps, Strategy And Development 131 Strategy 133 Device And Application Management In The Enterprise 135 Mobile Enterprise Application Platforms (MEAPs) 136 Security In Enterprise Apps 138 Mobile Analytics 139 Getting Started 140 Deciding What To Measure 140 Defining How To Measure 142 Adjusting Your Code 143 Handling the results 143 Privacy 144 Learn More 146 Implementing Rich Media 147 Streaming vs. Local Storage 149 Progressive Download 149 Media Converters 151 Implementing Location-Based Services 152 How To Obtain Positioning Data 153 Mapping Services 154 Implementing Location Support On Different Platforms 156 Tools For LBS Apps 158 Near Field Communication (NFC) 160 NFC Modes Of Operation 162 Current uses of NFC 163 Implementation of NFC 165 Implementing Haptic Vibration 165 Design Considerations 167 iOS 167 Android 169 BlackBerry 10 169 Windows 8 171 Implementing Augmented Reality 171 AR Usage Scenarios in Mobile 173 Tracking 174 Augmented Reality SDKs 177 AR Developing 101 181 Application Security 182 Threats to Your Applications 183 Protecting Your Application 187 Best Practices 188 Tools 189 Learn More 190 The Bottom Line 192 Testing Your Application 192 Testability: The Biggest Single Win 193 Test-Driven Development 194 Unit Testing 195 Testing Through The Five Phases of an App's Lifecycle 200 Interactive Testing 203 Test Automation 206 Beware Of Specifics 208 Monetization 208 Pay Per Download 211 In-App Payment 212 Mobile Advertising 213 Revenue Sharing 214 Indirect Sales 214 Component Marketplace 216 Choosing your Monetization Model 218 Appstores 221 What Can You Earn? 222 Learn More 224 Epilogue 225 About the Authors 8 Prologue It has been exactly four years now since we published the first version of this guide. In the prologue of that first guide, we said: "The most important issues for mobile developers are for sure fragmentation and distribution". Although the mobile ecosystem’s landscape has seen massive changes since then, we still think this holds true. And it keeps changing: This 12th edition probably introduces more changes than any other release before. To reflect recent shifts in the market, we decided to remove the dedicated chapters about Qt and bada and replace them with new, platform-independent chapters which cover key technologies such as Augmented Reality, Ana- lytics and Prototyping. Additionally, the general introduction chapter has been significantly expanded and now provides a comprehensive, updated overview on the ever changing mobile world. All other chapters have, of course, also been revised and updated. You will hardly find a more objective and up-to-date guide that teaches you how to get started as an app provider or developer, and how to lift your existing mobile offering to the next level. What happened in the mobile industry since our last release? Apple released iPhone 5 with great success, Android became the clear global leader in smartphone systems, and Microsoft released both Windows 8 and Windows Phone 8. Mark Zuck- erberg criticized Facebook's own HTML5 approach and found massive usage growth after turning to native apps. Then there was Canonical presenting Ubuntu for mobile phones. Finally, BlackBerry surprised us developers with love songs and released the BlackBerry 10 OS. Prologue I We will establish a bi-annual release cycle from now on. So expect the 13th edition around October 2013. If you are missing content, want to get involved one way or the other, or know of potential sponsors for the project: Get in touch via [email protected]. This is an open community project and we invite all of you to push it even further forward. We are looking forward to hearing from you! Robert + Marco / Enough Software Bremen, February 2013 Prologue II The Galaxy of Mobile: An Introduction Welcome to the world of mobile development, a world where former giants stumble and new stars are born on a seemingly regular basis. The focus of this book is on developing mobile apps, which includes a number of phases including: planning & specifica- tion, prototyping & design, implementation, internal testing & deployment, deployment to an app store, discovery by users, installation, use and feedback. Ultimately, we want our users Robert Virkus & Marco Tabor & Matos Kapetanakis & Matos Tabor Robert Virkus & Marco to enjoy using our apps and to give us positive ratings to BY 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 con- sidered getting involved, we advise against further delay as the world is moving speedily towards mobile becoming the predominant form of computing and others will surely bypass you if you wait too long. While developing mobile apps has some commonalities with developing other software it has specific characteristics. We will cover some of these next. Topology: Form Factors and Usage Patterns You have to differentiate between smart phones, tablets and feature phones. Each form factor poses its own usability chal- lenges; for instance, a tablet demands different navigation than a phone. TV systems are getting more traction as another form factor for mobile developers. The Galaxy of Mobile: An Introduction 1 Android usage patterns, of course, differ from those on iOS, which also differ from those for Windows Phone apps, et cetera. You should, therefore, refrain from providing the identi- cal experience on all form factors or even all your target smartphone systems. Otherwise, you risk delivering a mediocre service to some 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 The Galaxy of Mobile: An Introduction 2 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 for 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; inversely, 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 it so that you can publish them in app stores, e.g. Phonegap3. Hybrid Apps A hyped controversy circles around whether native or web apps are the future. For many mobile app developers, this controversy does not really exist any longer as a hybrid approach to app development has become quite common place: 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 same app. A hybrid app makes 3 www.phonegap.com 3 use of native and web technologies. Parts of it behave as a native app, while other parts are powered by web technologies. These parts can use Internet connectivity to offer up-to-date content. While this could be viewed as a drawback, the use of web technologies enables developers to display up-to-date content without the need to re-submit the application to app stores.