Amazon Web Services for Mobile Developers: Building Apps with AWS
Buy Rights Online Buy Rights

Rights Contact Login For More Details

More About This Title Amazon Web Services for Mobile Developers: Building Apps with AWS

English

A practical, real-world introduction to AWS tools and concepts

Amazon Web Services for Mobile Developers: Building Apps with AWS presents a professional view of cloud computing and AWS for experienced iOS/Android developers and technical/solution architects. Cloud computing is a rapidly expanding ecosystem, and working professionals need a practical resource to bring them up-to-date on tools that are rapidly becoming indispensable; this book helps expand your skill set by introducing you to AWS offerings that can make your job easier, with a focus on real-world application. Author and mobile applications developer Abhishek Mishra shows you how to create IAM accounts and try out some of the most popular services, including EC2, Lambda, Mobile Analytics, Device Farm, and more. You'll build a chat application in both Swift (iOS) and Java (Andoid), running completely off AWS Infrastructure to explore SDK installation, Xcode, Cognito authentication, DynamoDB, Amazon SNA Notifications, and other useful tools. By actually using the tools as you learn about them, you develop a more intuitive understanding that feels less like a shift and more like a streamlined integration.

If you have prior experience with Swift or Java and a solid knowledge of web services, this book can help you quickly take your skills to the next level with a practical approach to learning that translates easily into real-world use.

  • Understand the key concepts of AWS as applied to both iOS and Android developers
  • Explore major AWS offerings for mobile developers, including DynamoDB, RDS, EC2, SNS, Cognito, and more
  • Learn what people are talking about when they use buzzwords like PaaS, IaaS, SaaS, and APaaS
  • Work through explanations by building apps that tie into the AWS ecosystem

Any job is easier with the right tools, and Amazon Web Services for Mobile Developers: Building Apps with AWS gets you acquainted with an ever-expanding toolkit for mobile app development.

English

ABOUT THE AUTHOR

Abhishek Mishra has been active in the IT industry for over 19 years and has extensive experience with a wide range of programming languages, enterprise systems and platforms. He holds a master's degree in Computer Science from the University of London and currently provides consultancy services to Barclays Bank PLC in London as a Solutions Architect. He is the author of iOS Code Testing, iPhone and iPad App – 24 Hour Trainer, Swift iOS – 24 Hour Trainer, and the technical reviewer of Professional iOS Programming.

ABOUT AMAZON WEB SERVICES

Amazon Web Services offers a broad array of global cloud-based products, including tools for computing, storage, databases, analytics, and networking; mobile and developer tools; management tools; lot, security, and enterprise applications. AWS is used by large enterprises and hot startups alike to power a wide variety of workloads, including web and mobile applications, game development, data processing and warehousing, storage, archiving, and many more. Learn more at https://aws.amazon.com.

English

Introduction xix

Part I Introduction to Amazon Web Services 1

Chapter 1 Introduction to Cloud Computing and Amazon Web Services 3

What Is Cloud Computing? 4

Cloud Service Models 5

Cloud Deployment Models 7

The AWS Ecosystem 7

Sign Up for an AWS Free Tier Account 10

Step 1: Contact Information 10

Step 2: Payment Information 12

Step 3: Identity Verification 14

Step 4: Support Plan Selection 16

Step 5: Confirmation 17

Summary 17

Chapter 2 Regions, Availability Zones, and Edge Locations 19

Regions and Availability Zones 20

Edge Locations 22

Accessing AWS 24

The AWS Management Console 25

Summary 31

Chapter 3 AWS Identity and Access Management 33

Key Concepts 34

Root Account 34

User 35

Group 37

Policy 38

Role 38

Common Tasks 39

Creating a User 42

Assigning Permissions to an Existing User 47

Creating a Group 49

Adding Users from a Group 50

Creating a Role 51

Securing the Root Account with MFA 54

Setting Up an IAM Password Rotation Policy 57

Summary 59

Chapter 4 Amazon EC2 61

Key Concepts 62

Instances and Instance Types 62

Amazon Machine Images 65

Security Groups 66

Pricing Models 67

Data Storage 68

Instance Life Cycle 68

Common Tasks 70

Creating an Instance 70

Managing Existing Instances 81

Accessing Amazon EC2 Instances Using the AWS CLI 88

Linux, Mac OSX, Unix Users 88

Windows Users 92

Summary 100

Chapter 5 Amazon S3 101

Key Concepts 102

Buckets 102

Object Key 102

Object Value 103

Version ID 103

Storage Class 103

Costs 104

Subresources 104

Object Metadata 105

Common Tasks 106

Creating a Bucket 106

Uploading an Object 110

Accessing an Object 114

Changing the Storage Class of an Object 118

Deleting an Object 118

Amazon S3 Bucket Versioning 119

Accessing Amazon S3 Using the AWS CLI 123

Summary 124

Chapter 6 Amazon DynamoDB 125

Key Concepts 126

Tables 126

Items 126

Attributes 127

Primary Keys 127

Secondary Indexes 127

Queries 128

Contents xi

Scans 128

Read Consistency 128

Provisioned Throughput 129

Common Tasks 130

Creating a Table 130

Adding Items to a Table 134

Creating an Index 138

Performing a Scan 140

Performing a Query 142

Summary 143

Chapter 7 AWS Lambda 145

Common Use Cases for AWS Lambda 146

Key Concepts 147

Supported Languages 147

AWS Lambda Functions 147

Programming Model 148

Execution Environment 152

Common Tasks 153

Creating a Simple Node.js Lambda Function

Using the AWS Management Console 154

Testing an AWS Lambda Function Using the AWS

Management Console 160

Deleting an AWS Lambda Function Using the

AWS Management Console 163

Summary 165

Bonus Chapter 1 Amazon Simple Notification Service 1

Key Concepts 2

Topic 2

Publisher 3

Subscriber 3

Common Tasks 4

Creating a Topic 5

Creating an E-Mail Subscription 6

Creating an Amazon SMS Subscription 9

Posting a Message to a Topic 10

Summary 13

Bonus Chapter 2 Amazon Mobile Analytics 1

Key Concepts 2

App 2

Supported Client Platforms 3

Session 3

Events 3

Amazon Cognito Identity Pool 4

Reports 4

Common Tasks 5

Adding an App to Amazon Mobile Analytics 5

Viewing Standard Reports 13

Summary 20

Bonus Chapter 3 AWS Device Farm 1

Key Concepts 2

Devices 3

Device Slots 3

Automated Test Types 3

Run 5

Job 5

Project 5

Report 5

Session 6

Common Tasks 6

Creating a Project 7

Creating a New Test Run with an iOS Application 8

Creating a New Test Run with an Android Application 21

Creating an Interactive Session 28

Summary 31

Bonus Chapter 4 Installing WordPress on Amazon EC2 1

Prerequisites 2

Creating an Amazon EC2 Instance 3

Installing WordPress on Your Amazon EC2 Instance 9

Installing Apache, PHP, and MySQL 11

Creating a MySQL User and Database for WordPress 17

Installing and Configuring WordPress 19

Summary 23

Part II AWS for iOS Developers 167

Chapter 8 Integrating the AWS SDK for iOS 169

Integrating the AWS SDK for iOS Using CocoaPods 170

Integrating the AWS SDK for iOS Using Carthage 175

Integrating the AWS SDK for iOS Using Dynamic Frameworks 182

Summary 185

Chapter 9 Implementing User Signup and Login Using

Amazon Cognito User Pools 187

Introducing Amazon Cognito User Pools 188

Examining the AWSChat Xcode Project 189

Creating an Amazon Cognito User Pool 190

Pool Name 192

User Attributes 193

Password Security Policy 194

MFA and Account Verification 195

Message Customization 196

Cost Allocation Tags 197

Devices 198

Apps 198

Review and Create 201

Retrieving the App Client Secret 202

Updating the AWS Chat Application 204

Creating the User Pool Controller Class 204

Updating the Login View Controller 215

Updating the Signup View Controller 219

Updating the Home View Controller 231

Managing Users 231

Summary 232

Chapter 10 Implementing Login Using Facebook 233

Creating an App on Facebook 234

Adding the Facebook SDK to the

Xcode Project 239

Creating an Amazon Cognito

Identity Pool 246

Updating the Application User Interface 251

Summary 267

Chapter 11 Implementing Login Using Google 269

Adding the Google SDK to the

Xcode Project 270

Updating the Identity Pool 277

Updating the AWSChat Application 280

Summary 292

Chapter 12 Accessing Amazon DynamoDB 293

Creating Amazon DynamoDB Tables 295

Creating the User Table 296

Creating the Friend Table 300

Creating the Chat Table 300

Creating the Message Table 301

Updating the IAM Policy Used by the Identity Pool 303

Creating an IAM Service Role 307

Populating the User Table with an AWS Lambda Function 310

Testing the AWS Lambda Function 320

Updating the AWSChat App 322

Creating Model Classes 323

Creating the ChatManager Class 328

Creating the DynamoDBController Class 329

Updating the CognitoIdentityPoolController Class and the

Amazon Cognito Identity Pool 341

Updating the Home View Controller 349

Adding Friends 354

Summary 361

Chapter 13 Adding AWSChat Support with Amazon DynamoDB and Amazon S3 363

Updating the DynamoDBController Class 365

Configuring Amazon S3 370

Creating Buckets 370

Updating the Authenticated Identity Role 375

Creating the S3Controller Class 381

Updating the ChatManager Class 383

Updating the User Interface of the App 391

Summary 403

Chapter 14 Using AWS Lambda to Generate Thumbnails 405

Creating a Node.JS Lambda Function Deployment Package 407

Updating the AWS Lambda Execution Service Role 415

Creating an AWS Lambda Function Using the AWS

Management Console 418

Testing the AWS Lambda Function 423

Updating the S3Controller Class 428

Updating the ChatManager Class 431

Updating the User Interface of the App 432

Summary 434

Bonus Chapter 5 Adding Support for Apple Push Notifications 1

High-Level Steps 3

Configuring the App on the Apple Developer Website 4

Registering an Application Identifier 5

Creating a Development Provisioning Profile 7

Creating an SSL Certificate 11

Extracting the Private Key from the Certificate 15

Converting the Certificate and Private Key to PEM Files 17

Creating a Platform Application on Amazon SNS 17

Updating the IAM Policy 20

Updating the AWSChat Application 24

Creating the SNSController Class 25

Updating the Application Delegate 27

Contents xv

Updating the Home View Controller 29

Sending a Push Notification to the Device 30

Using an Amazon SNS Topic to Send

Push Messages 32

Summary 35

Bonus Chapter 6 Integrating Amazon Mobile Analytics with the iOS App 1

Adding an App to Amazon Mobile Analytics 3

Updating the AWSChat Application 9

Creating the MobileAnalytics Class 9

Generating Analytics Events 11

Viewing Analytics Reports 12

Summary 13

Part III AWS for Android Developers 435

Chapter 15 Integrating the AWS SDK for Android with Android Studio 437

Integrating the AWS SDK for Android Using Gradle 438

Integrating the AWS SDK for Android by Importing JAR Files 442

Summary 443

Chapter 16 Implementing User Signup and Login Using Amazon Cognito User Pools 445

Introducing Amazon Cognito User Pools 446

Examining the AWSChat Android Studio Project 447

Creating an Amazon Cognito User Pool 448

Pool Name 451

User Attributes 451

Password Security Policy 453

MFA and Account Verification 454

Message Customization 455

Cost Allocation Tags 456

Devices 456

Apps 457

Review and Create 459

Retrieving the App Client Secret 460

Updating the AWS Chat Application 462

Creating the User Pool Controller Class 463

Updating the Login Activity 479

Updating the Signup Activity 483

Managing Users 495

Summary 496

Chapter 17 Implementing Login Using Facebook 497

Creating an App on Facebook 499

Adding the Facebook SDK to the Android Studio Project 504

Creating an Amazon Cognito Identity Pool 507

Retrieving the Identity Pool ID 512

Creating the Identity Pool Controller Class 514

Updating the Application User Interface 521

Summary 534

Chapter 18 Implementing Login Using Google 535

Installing the Google Play Services SDK 537

Creating an App on the Google Developer Console 537

Updating the Android Studio Project 543

Updating the Identity Pool 545

Using a Google+ Authentication Provider 548

Using an OpenID Connect Authentication Provider 549

Updating the Identity Pool Controller Class 554

Updating the Application User Interface 560

Summary 575

Chapter 19 Accessing Amazon DynamoDB 577

Creating Amazon DynamoDB Tables 579

Creating the User Table 580

Creating the Friend Table 585

Creating the Chat Table 585

Creating the Message Table 586

Updating the IAM Policy Used by the Identity Pool 587

Creating an IAM Service Role 592

Populating the User Table with an AWS Lambda Function 596

Testing the AWS Lambda Function 606

Updating the AWSChat App 608

Model Classes 609

The ChatManager Class 615

The DynamoDBController Class 616

Linking the User Pool to the Identity Pool 632

The Updated Home Activity 644

The AddFriendActivity Class 650

Summary 656

Chapter 20 Adding AWSChat Support with Amazon

DynamoDB and Amazon S3 657

Updating Project Settings 659

Updating the DynamoDBManager Class 659

Configuring Amazon S3 666

Creating Buckets 666

Updating the Authenticated Identity Role 671

Creating the S3Controller Class 676

Updating the ChatManager Class 679

Updating the User Interface of the App 687

Summary 710

Chapter 21 Using AWS Lambda to Generate Thumbnails 711

Creating a Node.js Lambda Function Deployment Package 713

Updating the AWS Lambda Execution Service Role 721

Creating an AWS Lambda Function Using the

AWS Management Console 724

Testing the AWS Lambda Function 730

Updating the S3Controller Class 735

Updating the ChatManager Class 737

Updating the User Interface of the App 738

Summary 746

Bonus Chapter 7 Adding Support for GCM Notifications 1

High-Level Steps 3

Retrieving the Server API Key 4

Creating a Platform Application on Amazon SNS 5

Updating the IAM Policy 8

Creating a New Role Policy 8

Updating an Existing Role Policy 12

Updating the AWSChat Application 14

Installing the Google Play Services SDK 14

Updating Project Settings 15

Creating the SNSController Class 20

Creating the SNSControllerGenericHandler Interface 24

Creating the Service Classes 24

Updating the Login Activity 27

Updating the Home Activity 29

Sending a Push Notification to the Device 29

Using an Amazon SNS Topic to Send Push Messages 32

Summary 35

Bonus Chapter 8 Integrating Amazon Mobile Analytics with the Android App 1

Adding an App to Amazon Mobile Analytics 3

Updating the AWSChat Application 10

Creating the MobileAnalytics Class 10

Generating Analytics Events 13

Viewing Analytics Reports 15

Summary 16

Index 747

loading