Ionic in Action
Hybrid Mobile Apps with Ionic and AngularJS
Jeremy Wilken
Foreword by Adam Bradley
  • September 2015
  • ISBN 9781633430082
  • 320 pages
  • printed in black & white

An informative introduction to Ionic and an in-depth guide to building better apps.

From the Foreword by Adam Bradley, Ionic Framework

Ionic in Action teaches web developers how to build cross-platform mobile apps for phones and tablets on iOS and Android. You'll learn how to extend your web development skills to build apps that are indistinguishable from native iOS or Android projects.

Table of Contents detailed table of contents

foreword

preface

acknowledgments

about this book

author online

about the cover illustration

Part 1 GETTING STARTED WITH IONIC

1. Introducing Ionic and Hybrid Apps

1.1. What is Ionic?

1.2. Types of mobile experiences

1.2.1. Native mobile apps

1.2.2. Mobile websites (web apps)

1.2.3. Hybrid apps

1.3. Understanding how the Ionic stack works

1.3.1. Ionic: user interface framework

1.3.2. Angular: web application framework

1.3.3. Cordova: hybrid app framework

1.4. Why Ionic?

1.4.1. Why Ionic is good for developers

1.4.2. Drawbacks of using Ionic

1.5. Prerequisites for building apps with Ionic

1.5.1. Experience with HTML, CSS, and JavaScript

1.5.2. Experience with web applications and Angular

1.5.3. Access to a mobile device

1.6. Supported mobile devices and platforms

1.6.1. Apple iOS

1.6.2. Google Android

1.7. Summary

2. Setting Up Your Computer To Build Apps

2.1. Quick-start guide

2.1.1. Setting up your development environment

2.1.2. Starting a new project

2.1.3. Project folder structure

2.1.4. Previewing in a browser

2.2. Setting up previewing environments

2.2.1. Installing platform tools

2.2.2. Setting up emulators

2.2.3. Setting up a connected device

2.2.4. Adding a platform to the

2.2.5. Previewing in an emulator

2.2.6. Previewing on a mobile device

2.3. Summary

3. What You Need to Know about AngularJS

3.1. AngularJS at a glance

3.1.1. Views and templates: describing the content

3.1.2. Controllers, models, and scope: managing data and logic

3.1.3. Services: reusable objects with methods

3.1.4. Two-way data binding: sharing between controller and view

3.2. Setting up for the chapter project

3.2.1. Getting the project files

3.2.2. Starting the development server

3.3. Basics for an Angular app

3.4. Controllers: for controlling data and business logic

3.5. Loading data: using the controller to load and display data in the view

3.5.1. Filters: convert data to display in the view

3.6. Handling click events to select a note

3.7. Create a directive to parse a note with Markdown

3.8. Using models to manage content editing

3.9. Saving and deleting a note

3.9.1. Adding the save() method

3.9.2. Using Angular forms for validation

3.9.3. Adding the remove method

3.10. Continuing with Angular

3.11. Chapter challenges

3.12. Summary

Part 2 BUILDING APPS WITH IONIC

4. Ionic navigation and core components

4.1. Set up chapter project

4.1.1. Create a new app and add code manually

4.1.2. Clone the finished app and follow along

4.2. Setting up the app navigation

4.2.1. Designing good app navigation

4.2.2. Declaring the app views with the state provider

4.3. Building the home view

4.3.1. Creating a content container

4.3.3. Adding icons to the list items

4.4. Using a controller and model for the reservation view

4.5. Loading data into the weather view

4.5.1. Adding the template for the weather view

4.5.2. Create weather controller to load external data

4.5.3. Adding a loading indicator to the weather view

4.6. Infinite scroll with cards for the restaurants view

4.7. Using the slidebox component for app intro tour

4.8. Chapter challenges

4.9. Summary

5. Tabs, advanced lists, and form components

5.1. Set up chapter project

5.1.1. Create a new app and add code manually

5.1.2. Clone the finished app and follow along

5.2. ionTabs: adding tabs and navigation

5.2.1. Adding tabs container and three tabs to the app

5.3. Adding ionNavView for each tab

5.4. Loading and displaying current Bitcoin rates

5.5. Display a currency’s details in the same tab view

5.6. Refresh the Bitcoin rates and display help

5.6.1. ionRefresher: pull to refresh the rates

5.6.2. $ionicPopover: showing help in a popover

5.7. Charting historical data

5.7.1. Setting up third-party libraries

5.7.2. History tab template using Highcharts and a select box to toggle currency

5.7.3. History tab controller loads data and sets up chart

5.8. Currencies tab with list reordering and toggles

5.8.1. ionReorderButton: adding reordering to a list

5.8.2. ionToggle: adding toggles to list items

5.9. Chapter challenges

5.10. Summary

6. Weather App, using Side Menus, Modals, Action Sheets, and ionScroll

6.1. Setting up the chapter project

6.1.1. Create a new app and add code manually

6.1.2. Clone the finished app and follow along

6.2. Setting up the side menu and views

6.3. Searching for locations

6.4. Adding settings view and data services

6.4.1. Create services for locations and settings

6.4.2. favorites in side menu list

6.4.3. Adding the settings template

6.4.4. Settings view controller

6.5. Setting up the weather view

6.5.1. Get a Forecast.io API key

6.5.2. Using Ionic CLI proxies

6.5.3. Add the weather view controller and template

6.6. ionScroll: building custom scrolling content

6.6.1. Using ionScroll with paging

6.6.2. Creating filters for forecast data

6.7. Action sheet: displaying a list of options

6.8. ionModal: displaying the sunrise and sunset chart

6.8.1. Setting up a modal

6.8.2. Collection repeat: making the sunrise and sunset list fast

6.9. Popup: alert and confirm changes to favorites

6.10. Chapter challenges

6.11. Summary

7. Advanced techniques for professional apps

7.1. Set up chapter project

7.1.1. Get the code

7.2. Custom Ionic styling using Sass

7.2.1. Setting up Sass

7.2.2. Customize Ionic with Sass variables

7.2.3. Using Sass for your own styling

7.3. How to support online and offline mode

7.4. Handling gesture events in Ionic

7.4.1. Listen for events with Ionic event directives

7.4.2. Listen for events with $ionicGesture service

7.4.3. Available gesture events

7.5. Storing data for persistence

7.5.1. Using localStorage

7.5.2. Using Web SQL, IndexedDB, and SQLite

7.5.3. Other options from Cordova plugins

7.6. Building one app for multiple platforms

7.6.1. One size doesn’t always fit all

7.6.2. Adapt styling for a platform or device type

7.6.3. Adapt behavior for a platform or device type

7.7. Modify default behaviors with $ionicConfigProvider

7.8. Summary

Part 3 ADVANCED DEVELOPMENT AND DEPLOYMENT

8. Using Cordova Plugins

8.1. Cordova plugins

8.1.1. Considerations when using plugins

8.1.2. Installing plugins

8.1.3. Using plugins

8.1.4. Using plugins with emulators

8.1.5. Plugins and platform limitations

8.1.6. Angular and Cordova gotchas

8.1.7. Solutions to common issues with devices or emulators

8.2. ngCordova

8.2.1. Installing ngCordova

8.3. Using a camera and photos in the resort app

8.3.1. Setting up the camera project

8.3.2. Adding the camera plugin

8.3.3. Creating the photo book view

8.4. Using geolocation in the weather app

8.4.1. Setting up the geolocation example

8.4.2. Adding the geolocation plugin and ngCordova

8.4.3. Requesting a user’s location

8.4.4. Improving the weather app

8.5. Chapter challenges

8.6. Summary

9. Previewing, debugging, and automated testing

9.1. The differences among previewing, debugging, and testing

9.1.1. Why testing is important

9.2. Setting up the chapter example

9.3. Additional ways to preview apps

9.3.1. Ionic Lab

9.3.2. Ionic View

9.4. Debugging from a device

9.4.1. Debugging from an Android device

9.4.2. Debugging from an iOS device or emulator

9.5. Automated testing

9.5.1. Unit tests with Jasmine and Karma

9.5.2. Integration tests with Protractor and WebDriver

9.6. More test examples

9.7. Summary

10. Building and Publishing Apps

10.1. Building for production: an overview

10.2. Building icons and splash-screen assets

10.2.1. Creating the primary icons

10.2.2. Creating the splash-screen images

10.3. Preparing your app for production

10.4. Building Android apps and publishing to Google Play

10.4.1. Setting up for signing your apps

10.4.2. Build the release app file

10.4.3. Signing the APK file

10.4.4. Optimize the APK

10.4.5. Building an updated version of your app

10.4.6. Creating the app listing and uploading the app to the Play Store

10.4.7. Updating the app listing or uploading a new version

10.4.8. Using alternative Android stores

10.5. Building iOS apps and publishing to the AppStore

10.5.1. Set up certificates and ID

10.5.2. Set up an app ID identifier

10.5.3. Create listing in iTunes Connect

10.5.4. Build and upload app with Xcode

10.5.5. Complete the iTunes Connect app listing

10.5.6. Updating the app

10.6. Summary

Appendix A: Additional Resources

A.1. Ionic

A.2. Angular

A.3. Cordova

A.4. Blogs

About the book

Wouldn't it be great if you could build mobile apps using just your web development skills? With Ionic, you can do just that: create hybrid mobile apps using web technologies that you already know, like HTML, CSS, and JavaScript, that will run on both iOS and Android.

Ionic in Action teaches web developers how to build mobile apps using Ionic and AngularJS. Through carefully explained examples, the book shows you how to create apps that use UI components designed for mobile, leverage current location, integrate with native device features like the camera, use touch gestures, and integrate with external data sources. Learn to test your apps to improve stability and catch errors as you develop. Finally, you'll discover the command-line utility, and how to build and deploy to app stores.

What's inside

  • Create mobile apps with HTML, JavaScript, and CSS
  • Design complex interfaces with Ionic's UI controls
  • Build once and deploy for iOS and Android
  • Use native device hardware and device-specific features
  • Covers the entire mobile development process

About the reader

Readers should know HTML, CSS, and JavaScript. Familiarity with AngularJS is helpful but not required.

About the author

Jeremy Wilken is a senior UX software developer who works with Ionic, AngularJS, and Node.js. He lives in Austin, Texas.


combo $44.99 pBook + eBook
eBook $35.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks

A one-stop resource for the Ionic developer.

Andrea Prearo, ArcTouch

A must-read for web developers eager to quickly extend the reach of their web applications to mobile platforms.

Kevin Liao, Sotheby’s, Inc.

A key resource that contains everything you need to quickly create and deploy cross-platform apps from a single code base.

C. H. Graham, Cognipacity