Book Image

Getting Started with Ionic

By : Rahat Khanna
Book Image

Getting Started with Ionic

By: Rahat Khanna

Overview of this book

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.
Table of Contents (17 chapters)
Getting Started with Ionic
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

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.

What this book covers

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.

What you need for this book

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.

Who this book is for

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.

Conventions

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:

<ion-nav-bar class="bar-stable">
  <ion-nav-back-button>
  </ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<ion-nav-bar class="bar-stable">
  <ion-nav-back-button>
  </ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>

Any command-line input or output is written as follows:

$ ionic start MenuDemo sidemenu

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."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

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 , 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.

Customer support

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.

Downloading the example code

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.

Running the example code

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.

Downloading the color images of this book

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.

Errata

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

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.