Mastering Mobile Application Development - 2nd Edition
Mastering Mobile Application Development - 2nd Edition
Learning iOS and Android Side-By-Side
About the Book
This is an updated 2nd Edition of the previous version of the book. We've completely rewritten the book, and refreshed all code examples using the latest versions of Xcode/iOS and Android Studio. In addition, on the Android material, we've replaced the Java language with Kotlin! This book offers developers an in depth tour of these two important platforms. Whether you are just learning to programmer, or you are a seasoned developer, this book will quickly help you grasp the concepts and become proficient.
Hundreds of books have been written on iOS and Android since the debut of these platforms more than a decade ago. Many of them are well-written by very capable authors. This leads to the inevitable question, why write another?
We have taught and developed on these platforms since they appeared, and also have worked on their predecessors (Java MicroEdition, Symbian, etc.) Over the years, we've made a number of observations. First, becoming proficient on either Android and iOS involves a fairly steep learning curve. To help with that of course, both Apple and Google provide very large and comprehensive sets of how-to guides and reference documentation. Second, while distinct in terms of programming languages, frameworks and basic vocabulary, these platforms actually have more in common than initially appears. Third, while developers tend to specialize on one or the other, it is not unusual for mobile app developers to become proficient on both platforms over time, as many production apps have both iOS and Android implementations.
Often we find ourselves in situations where we will be explaining a concept on one of the platforms to a student or developer in terms of what they already know about the other platform. Similarly, we will have students in one of our courses in which we are teaching iOS tell us they just got assigned to a new project at work involving Android or vice versa. At one point we attempted to teach a semester course in mobile app development teaching both Android and iOS at the same time. We realized very quickly that other than a few scattered blog posts, there was very little instructional material available that explored the platforms side-by-side in a comparative manner. Though we personally were proficient on both platforms, we had not spent enough time organizing our thoughts and materials in a way that would allow the learner to efficiently bridge concepts that related across the platforms, and simultaneously call out situations where a fundamentally different approach was called for due to intrinsic differences. Instead, our lessons tended to quickly diverge into the details and world of the specific platform and any conceptual overlap was completely obfuscated and lost to the students. The net result was that students spent an enormous amount of effort learning a little bit about both platforms.
These experiences and observations led us to the conclusion that we could do much better if we organized our thoughts and intentionally created a grand tour of both platforms that iteratively led the student from concept to concept in a logical manner, calling out the similarities and differences as we go. This vision, followed by a lot of discussion and hard work (and encouragement from students and colleagues!) has resulted in this book.
Our approach is to imagine a fictitious yet non-trivial app that is clearly representative of the many apps consumers currently use daily on their smartphones. Studying how this app is implemented on both iOS and Android in a logical step by step iterative fashion, exploring various facets of the platforms as we go. Each chapter therefore focuses on one a single key aspect of modern mobile apps and begins with a discussion of the concept itself, and a discussion of the commonalities and potential differences in iOS and Android, pertaining to that particular topic. Once the concepts have been fleshed out at a conceptual level, we then introduce concrete examples of how those features are implemented on both iOS and Android.
This comparative approach to learning a software-related topic is not without precedent. For many years accredited university computer science programs have offered courses in programming languages. These courses typically survey a variety of programming language principles, constructs, models, and styles, and illustrate them with concrete examples from a variety of programming languages. A common learning objective is to help the students understand programming language principles that lay beyond the mere syntax, and recognize the concept when it appears again in perhaps an entirely different syntax. Armed with these insights, the student not only learns to write better code in a particular language, but can also rapidly assimilate and learn new languages. For example, a student who has been exposed to lambdas in Ruby and who understand how Ruby implements such constructs, and when they are appropriate to use, will immediately recognize and understand closure expressions when they encounter them for the first time in Swift.
Given the enormous demand for mobile apps and the rapid pace in which iOS and Android are evolving (not mention the platforms that will soon appear on the horizon.) we believe this comparative approach that intentionally calls out concepts in a way that transcends the implementation details will serve the student aspiring to be a professional mobile app developer well. We believe this approach is also germane to the professional developer who is struggling to keep up with the constant avalanche of new mobile implementation frameworks, concepts, and in some cases even entirely new programming languages!
Hence our intended audience consists of both the computer science student, as well as the practicing professional developer. We believe this approach will help the mobile app newbie with no prior knowledge of mobile application development become rapidly proficient on both iOS and Android, and well-prepared to rapidly assimilate whatever our mobile app development futures may hold. We also believe this approach is an excellent way for the experienced developer who is already proficient on either iOS or Android and would like to become proficient on the other. By bridging the knowledge they already have to the other platform, they will quickly orient themselves and become productive.
Table of Contents
Preface
1 IDE
1.1 Mobile Development Overview
1.2 iOS and Android Contrasted
1.3 Development Environment
1.4 Xcode
1.5 Android Studio
2 Writing your First Mobile App
2.1 Traxy App Overview
2.2 Writing Your First Mobile Ap
2.3 Your First iOS App
2.4 Your First Android App
3 Mobile App Architectures
3.1 Mobile App Software Architecture
3.2 Archiectural Choices
3.2 App Lifecycles
3.4 The Android Manifest
4 Scene Transitions
4.1 Overview
4.2 Fleshing out Traxy for Login and User Signup
4.3 Scene transitions in iOS
4.4 Scene transitions in Android
5 User Interfaces
5.1 Laying out mobile user interfaces
5.2 Layout and styling on iOS
5.3 Layout and styling on Android
6 Collections of Data
6.1 Overview
6.2 Implementing UITableViews in iOS
6.3 Implementing Android RecylerViews
7 Libraries
7.1 Consume or Produce?
7.2 CocoaPods: Integrating 3rd Party Libraries in Xcode
7.3 Library Management in Android
8 Cloud Datastore Integration
8.1 Mobile backends
8.2 Integrating Firebase with iOS
8.3 Integrating Firebase with Android
9 Working with Multimedia
9.1 Personal Media Players
9.2 Multimedia in iOS
9.3 Multimedia in Android
10 Working with Audio
10.1 Working with Audio in iOS
10.2 Working with Audio in Android
11 Networking
11.1 Accessing Web APIs in Mobile Apps
11.2 Integrating web APIs in iOS
11.3 Integrating web APIs in Android
12 More on User Interfaces
12.1 UI navigation considerations
12.2 Tabs and collections in iOS
12.3 Tabs and Grid Layouts in Android
13 Location and Maps
13.1 Location Aware Apps
13.2 Maps and Location on iOS
13.3 Maps and Location on Android
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Do Well. Do Good.
Authors have earned$11,835,575writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
The Hitchhiker's Guide to DFIR: Experiences From Beginners and Experts
Barry Grundy, Tristram, John Haynes, ApexPredator, Andrew Rathbun, Kevin Pagano, Victor Heiland, Nisarg Suthar, Guus Beckers, and Jason WilkinsA first of its kind crowdsourced DFIR book written on GitHub by the members of the Digital Forensics Discord Server to share knowledge!
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
node-opcua by example
Etienne RossignonGet the best out of node-opcua through a set of documented examples by the author himself that will allow you to create stunning OPCUA Servers or Clients.
Discrete Mathematics for Computer Science
Alexander Shen, Alexander S. Kulikov, Vladimir Podolskii, and Alexander GolovnevThis book supplements the DM for CS Specialization at Coursera and contains many interactive puzzles, autograded quizzes, and code snippets. They are intended to help you to discover important ideas in discrete mathematics on your own. By purchasing the book, you will get all updates of the book free of charge when they are released.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Maîtriser Apache JMeter
Philippe Mouawad, Bruno Demion (Milamber), and Antonio Gomes RodriguesToute la puissance d'Apache JMeter expliquée par ses commiteurs et utilisateurs experts. De l'intégration continue en passant par le Cloud, vous découvrirez comment intégrer JMeter à vos processus "Agile" et Devops.
If you're looking for the newer english version of this book, go to Master JMeter : From load testing to DevOps
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Introduction to Data Science
Rafael A IrizarryThe demand for skilled data science practitioners in industry, academia, and government is rapidly growing. This book introduces concepts from probability, statistical inference, linear regression and machine learning and R programming skills. Throughout the book we demonstrate how these can help you tackle real-world data analysis challenges.
Rector - The Power of Automated Refactoring
Matthias Noback and Tomas VotrubaLearn how to automatically and continuously upgrade and improve your PHP code base
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
Top Bundles
- #1
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #2
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #3
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #4
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also... - #5
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #6
Software Architecture
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #9
Learn Git, Bash, and Terraform the Hard Way
3 Books
Learn Git, Bash and Terraform using the Hard Way method.These technologies are essential tools in the DevOps armoury. These books walk you through their features and subtleties in a simple, gradual way that reinforces learning rather than baffling you with theory. - #10
Static Analysis and Automated Refactoring
2 Books
As PHP developers we are living in the "Age of Static Analysis". We can use a tool like PHPStan to learn about potential bugs before we ship our code to production, and we can enforce our team's programming standards using custom PHPStan rules. Recipes for Decoupling by Matthias Noback teaches you in great detail how to do this, while also...