26,39 €
Get up and running with developing effective Hybrid Mobile Apps with Ionic
This book is ideal for any web developer who wants to enter into the world of mobile app development but has no clue where to start. Ionic is an ideal starting point and provides a smooth learning curve to help you build hybrid apps using web technologies and to develop native apps for iOS and Android, you do not need to know multiple languages. This book will also be useful for Hybrid App developers who have not found the perfect framework to ensure users get a rich experience from your apps.
Hybrid Apps are a promising choice in mobile app development to achieve cost effectiveness and rapid development. However, they were not preferred over native apps until few years back due to a poor performance and bad user experience, but everything has changed with the release of Ionic. It has evolved as the most popular choice for Hybrid Mobile App development as it tends to match the native experience and provides robust components/tools to build apps.
Getting Started with Ionic equips any web developer with the basic knowledge needed to use modern web technologies to build amazing hybrid mobile apps using Ionic.
This fast-paced, practical book explains all the important concepts of AngularJS and Cordova Framework required to develop apps, then gives you a brief introduction to hybrid mobile applications. It will guide you through setting up the environment to develop mobile apps, and through the multiple options and features available in Ionic so you can use them in your mobile apps. Features such as the Side Menu, Tabs, Touch Interactions, and native features such as Bar Code, Camera, and Geolocations are all covered.. Finally, we'll show you how to use Cordova plugins and publish your apps.
Getting started with Ionic is a compact, easy-to-follow guide to developing hybrid mobile apps using Ionic with real world examples of building an e-commerce app.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 193
Veröffentlichungsjahr: 2016
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2016
Production reference: 1070116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-057-0
www.packtpub.com
Author
Rahat Khanna
Reviewer
Nikola Brežnjak
Commissioning Editor
Dipika Gaonkar
Acquisition Editor
Aaron Lazar
Content Development Editor
Priyanka Mehta
Technical Editor
Dhiraj Chandanshive
Copy Editor
Joanna McMahon
Project Coordinator
Izzat Contractor
Proofreader
Safis Editing
Indexer
Rekha Nair
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph
This book is the result of four months of intensive writing and coding on the part of Rahat Khanna, a dedicated Ionic community member, experienced developer, and excellent writer. We were really happy to hear that Rahat was writing an Ionic book because we think very highly of his blog posts, which have also been very popular among members of our developer community.
The book is ideal for new Ionic developers who have some prior web development experience. The book contains code samples related to a single app that readers build as they move from chapter to chapter.
In the first few chapters, Rahat offers a solid conceptual base for Angular and for Hybrid Mobile App development in general. He teaches users how to set up a native development environment and use the Ionic command-line interface.
In later chapters, Rahat takes a deep dive into Ionic's architecture and different components. Experienced Ionic developers will appreciate his chapters on integrating backend services and mBaaS with Ionic apps.
In addition, the book touches upon Ionic Platform Services and Ionic 2's new features and migration path.
By the time they complete this book, readers will be able to build a mobile application with a native-looking user interface and interactions with device APIs and publish it to the app stores.
I began my career as a developer and built many internal Hybrid Apps for my company. I chose Ionic because it offered the only complete solution for Hybrid Mobile App development, which allows me to focus on development; whereas Ionic handled architecture and design. Ionic offers a complete ecosystem to build performant, beautiful mobile apps using a single code base, which saves organization's both money and time and allows them to leverage the existing skills of their web developers.
As a core team member of Ionic and Ionic's developer advocate, I travel around the U.S. to speak about Ionic and teach developers how to use it. I hope that you find this book to be a great introduction to Ionic and also a way to build upon your existing skills.
Mike Harlington
Providence, Rhode Island
Rahat Khanna is a techno-nerd experienced in developing web and mobile apps for many international MNCs and start-ups. He has completed his Bachelors in Technology with Computer Science & Engineering as specialisation. During the past 7 years, he has worked for a multinational IT service company and ran his own entrepreneurial venture also in his early twenties. He has worked on ranging projects from static HTML websites to scalable web applications and engaging mobile apps. Along with his current job as a Senior UI developer at Flipkart, a billion dollar e-commerce firm, he now blogs on the latest technology frameworks on sites www.airpair.com, appsonmob.com, and so on and delivers talks at community events. He has been helping individual developers and startups in their Ionic projects to deliver amazing mobile apps.
I live in Bangalore, India with my wife Palak who has been instrumental in motivating me to share my knowledge with the world and write this book. Also, I would like to thank my parents and family to support me in my endeavours. I would also like to thank Packt Publishing and their entire team for helping constantly throughout the whole experience of finishing the book. Finally, I am also indebted to all my career mentors and colleagues especially Sunil Khokhar and Rahul Luthra who have helped me in constantly learning new things and growing as a professional.
Nikola Brežnjak is an engineer at heart and a jack-of-all-trades kind of guy. For those who care about titles, he has a master's degree in computing. For the past eight years, he worked in the betting software industry where he made use of his knowledge in areas ranging from full stack (web and desktop) development to game development through Linux and database administration and use of various languages (C#, PHP, JavaScript to name just a few). Recently, he's been interested in the Ionic Framework, and he likes to help out on StackOverflow where he is currently in the top 0.X%.
He self-published the book Getting MEAN with MEMEs via Leanpub, available at https://leanpub.com/meantodo. Also, he self-published the book about Ionic Framework via Leanpub, https://leanpub.com/ionic-framework. He was a technical reviewer for the book Deploying Node.js, Sandro Pasquali, as well as for the video Beginning Ionic Hybrid Application Development, Troy Miles, both by Packt Publishing. You can find out more about him through his blog at http://www.nikola-breznjak.com/blog.
He lives in Croatia with his lovely wife and daughter whom he would like to thank to support him in all his geeky endeavors. Also, he would like to thank his parents to teach him the power of hard and consistent work.
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Hybrid Mobile Apps have become a promising choice in mobile app development to achieve cost effectiveness and rapid development. Ionic has been instrumental in setting the benchmark in this space as it focuses on performance. It has evolved as the most popular choice for Hybrid Mobile App development as it tends to match the native experience and provides robust components/tools to build apps.
Getting Started with Ionic equips any web developer with the practical knowledge required to use modern web technologies in building amazing Hybrid Mobile Apps using Ionic. This fast-paced, practical book explains all the important concepts of AngularJS and Cordova framework required to develop Ionic apps. Then, it gives you a brief introduction to Hybrid Mobile Applications. It will guide you through setting up the development environment for different mobile platforms and through the multiple options and features available in Ionic, so you can use them in your mobile apps. Features, such as the side menu, tabs, touch interactions, and native features, such as bar code, camera, and geolocations, are all covered. Finally, we'll show you how to use Cordova plugins and use Ionic cloud services to empower your mobile apps.
Chapter 1, All About Hybrid Mobile Apps and Ionic Framework, covers the introduction to Hybrid Mobile Applications and the technologies used to develop these apps. This chapter will also include all important concepts regarding AngularJS and Apache Cordova, which readers need to know before building Ionic apps.
Chapter 2, Setting up the Environment the Right Way, covers setting up the native development environments for required platforms and then installing Ionic and required dependencies to start building Ionic apps. It will include details about Ionic command-line interface and the important features it provides for rapid development.
Chapter 3, Start Building Your First Ionic App, includes instructions for starting a new project and leveraging Ionic starter templates to bootstrap easily. It also covers the explanation about the design of the app structure and how you can plan to develop your app on top of it.
Chapter 4, Navigation and Routing in an Ionic App, covers how to create routes and layouts for navigation. It will teach the reader about views, Ionic header/footer sections, and different layout components, such as tabs, side menu, and modals. It also includes the basic routes and navigation setup for our sample app.
Chapter 5, Accessorizing Your App with Ionic Components, covers different components, which will be used in building the mobile app. It has two major categories: one is CSS components, which include grid framework and some reusable CSS classes to be used to design UI. The other category is Javascript components, which will facilitate building the business logic and UI interactions for the app.
Chapter 6, Integrating App with Backend Services, includes explanation about creating Ionic services and factories, which will interact with backend services. Ionic Apps can be integrated with all kinds of web services, REST APIs, SOAP services, and even cloud-based mBaaS (Mobile Backend as a Services) such as Parse and Firebase.
Chapter 7, Testing App on Real Devices, covers tools and techniques used to test and debug the app on your actual devices.
Chapter 8, Working with Cordova Plugins - ngCordova, teaches the reader how to use ready-made Cordova plugins, which help the mobile app to talk to native device APIs, such as sensors, camera, and geolocation. It will also explain how to integrate an open source Angular wrapper named ngCordova for cordova plugins into an Ionic App.
Chapter 9, Future of Ionic, includes an introduction to various cloud Ionic services available online under the Ionic.io platform. It also covers about the future of Ionic v2 along with Angular v2 talking about new features and migration path.
For this book, you require a system with Windows, Mac, or Linux OS. You need to install NodeJS and NPM to manage dependencies for different projects. This book will guide you through the setup for mobile app development platforms for iOS and Android. Test devices having Android and iOS would be required to test the mobile apps.
This book is ideal for any web developer who wants to enter into the world of mobile app development but has no clue where to start. Ionic is an ideal starting point and provides a smooth learning curve to help you build Hybrid Apps using web technologies and to develop native apps for iOS and Android; you do not need to know multiple languages. This book will also be useful for Hybrid App developers who have not found the perfect framework to ensure that users get a rich experience from your apps.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, code tags, user input, and Twitter handles are shown in bold.
A block of code is set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In order to run an app on an Android device, enable Developer Options and check the USB Debugging option from the settings."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
The example codes available on the website are taken from Ionic Projects. In order to run them successfully on your machines, you need to create an empty Ionic Project and then copy the example code files to the www folder of your Ionic Project and then run npm install first and then ionic serve command to run locally or ionic run [android|ios] to run on the device.
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/0570OS_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
In this chapter, we are going to learn what a Hybrid Mobile Application is and the current technology ecosystems supporting it. We will also be introduced to Ionic Framework and the reasons that should lead you to decide on Ionic as your preferred choice. The topics covered in this chapter will be as follows:
The term 'website' has become a word of the past. 'App' is the new buzzword, and the world is moving away from old software systems to new jazzy apps. App, or application in terms of a software, is a more sophisticated system, which involves enabling a lot more features to the user rather than just providing static information like a traditional website.
Web apps have a lot of limitations such as requiring Internet connectivity all the time and restrictions on fully utilizing the hardware capabilities of the device on which you are accessing them. Mobile apps, on the other hand, defy all of these limitations and provide an engaging user experience.
Mobiles have emerged as the most popular channel for user engagement. The number of smartphone users is expected to grow to nearly 2.16 billion in 2016 (http://www.emarketer.com/Article/2-Billion-Consumers-Worldwide-Smartphones-by-2016/1011694), which is more than one quarter of the global population. The growth rate of smartphone usage has been tremendous and is expected to grow day by day.
Mobile adoption is associated with some of the following trivial points:
