万本电子书0元读

万本电子书0元读

顶部广告

Learn Spring for Android Application Development电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:S. M. Mohi Us Sunnat

出  版  社:Packt Publishing

出版时间:2019-01-31

字       数:38.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
A hands-on guide to Android programming with Spring MVC, Spring Boot, and Spring Security Key Features * Build native Android applications with Spring for Android * Explore Reactive programming, concurrency, and multithreading paradigms for building fast and efficient applications * Write more expressive and robust code with Kotlin using its coroutines and other latest features Book Description As the new official language for Android, Kotlin is attracting new as well as existing Android developers. As most developers are still working with Java and want to switch to Kotlin, they find a combination of these two appealing. This book addresses this interest by bringing together Spring, a widely used Java SE framework for building enterprise-grade applications, and Kotlin. Learn Spring for Android Application Development will guide you in leveraging some of the powerful modules of the Spring Framework to build lightweight and robust Android apps using Kotlin. You will work with various modules, such as Spring AOP, Dependency Injection, and Inversion of Control, to develop applications with better dependency management. You’ll also explore other modules of the Spring Framework, such as Spring MVC, Spring Boot, and Spring Security. Each chapter has practice exercises at the end for you to assess your learning. By the end of the book, you will be fully equipped to develop Android applications with Spring technologies. What you will learn * Get to grips with the basics of the Spring Framework * Write web applications using the Spring Framework with Kotlin * Develop Android apps with Kotlin * Connect a RESTful web service with your app using Retrofilt * Understand JDBC, JPA, MySQL for Spring and SQLite Room for Android * Explore Spring Security fundamentals, Basic Authentication, and OAuth2 * Delve into Concurrency and Reactive programming using Kotlin * Develop testable applications with Spring and Android Who this book is for If you’re an aspiring Android developer or an existing developer who wants to learn how to use Spring to build robust Android applications in Kotlin, this book is for you. Though not necessary, basic knowledge of Spring will assist with understanding key concepts covered in this book.
目录展开

Title Page

Copyright and Credits

Learn Spring for Android Application Development

Dedication

About Packt

Why subscribe?

Packt.com

Contributors

About the authors

About the reviewers

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

About the Environment

Technical requirements

Setting up the environment

Spring

Java

Kotlin

Apache Tomcat

Configuring Tomcat

Verifying Tomcat

Integrated development environment

IntelliJ IDEA

Eclipse

Android

Summary

Questions

Further reading

Overview of Kotlin

Technical requirements

Introduction to Kotlin

Setting up the environment

Build tools

Basic syntax

Defining packages

Defining variables

Defining functions

Defining classes

Object-oriented programming

Functions

Functional programming

Declarative and imperative styles

Extension functions

Collections in Kotlin

Higher-order functions

Lambdas

Control flow elements

The if { ... } else { ... } expression

The when { ... } expression

Loops

for loops

while loops

Ranges

String templates

Null safety, reflection, and annotations

Null safety

Reflection

Annotations

Summary

Questions

Further reading

Overview of Spring Framework

Technical requirements

Introduction to Spring

The advantages of Spring

Spring Architecture

Core containers

Data Access/Integration

Web

Aspect-oriented programming

Instrumentation

Test

Configuring beans

Spring configuration metadata

XML-based configuration

Bean scopes

Singleton scope

Prototype scope

Bean life cycle

Dependency injection

Auto-wiring beans

Annotation-based configuration

The @Required annotation

The @Autowired annotation

The @Qualifier annotation

Code-based configuration

The @Configuration and @Bean annotations

Dependency injection bean

The @Import annotation

Life cycle callbacks

Creating a scope bean

Spring MVC

DispatcherServlet

Creating a project

Converting to a Maven project

Spring MVC dependencies to pom.xml

Creating Spring configuration beans

Creating a controller class

The view

IntelliJ Ultimate

Eclipse

SpringBoot

Creating a project

Creating an application class

Summary

Questions

Further reading

Spring Modules for Android

Technical requirements

REST client module

The RestTemplate module

Gradle and Maven repository

Gradle

Maven

RestTemplate constructors

RestTemplate functions

HTTP GET

HTTP POST

HTTP PUT

HTTP DELETE

HTTP OPTIONS

HTTP HEAD

Retrofit

The use of Retrofit

Advantages of Retrofit

Configuring Retrofit

Downloading Retrofit

HTTP request functions

GET

PUT

DELETE

HEAD

Creating an Android app

Gradle information

Gradle dependencies

Creating a model

Implementing a service

Calling callback

Creating an interface

Mobile applications

Summary

Questions

Further reading

Securing Applications with Spring Security

Technical requirements

Spring Security architecture

Authentication

Modifying authentication managers

Authorization

Web security

Method Security

The advantages of Spring Security

Spring Security features

Spring Security modules

Implementing Spring Security

Maven

Gradle

Securing REST with basic authentication

What is basic authentication?

Creating a project

Configuring pom.xml

Configuring a Spring bean

Configuration for Spring Security

Configuring an authentication entry point

Configuring Spring WebApplicationInitializer

Creating a user model

Creating a controller

Using the HTTP client

Creating an Android app

Gradle information

Gradle dependencies

Creating a user model

Implementing the user service

Authenticating with OkHttp interceptors

Calling callbacks

Creating the UI

Creating a custom list adapter

Mobile applications

Securing REST with Spring Security OAuth2

What is OAuth2?

OAuth2 Roles

OAuth2 grant types

Creating a project

Maven dependencies

Configuring the resource server

Configuring the authorization server

Creating the security config

Creating the controller class

Creating the application class

Application properties

Checking the output

Checking unprotected URLs

Getting access tokens

Accessing the protected URL

Common mistakes and errors

Summary

Questions

Further reading

Accessing the Database

Technical requirements

Database

Types of database

Personal database

Relational database

Distributed database

Object-oriented database

NoSQL database

Graph database

Cloud database

Database management system

Data access in the Spring

Java database connectivity in Spring

Creating a sample project using JDBC

Maven dependencies

Creating DataSource

Creating a table in database

Creating a model

Creating row mapper

Creating an API interface

Creating a user repository

JdbcTemplate implementation

Creating HTTP methods for RESTful APIs

Create

READ

UPDATE

DELETE

Creating service

Creating controller

Autowired service

Getting the user list

Getting one user by ID

Inserting a new user

Updating a user

Deleting a user

Testing the output

Getting the user list

Getting one user by ID

Inserting a new user

Updating a user

Deleting a user

Java Persistence API

Architecture of JPA

Creating a project using JPA

Maven dependencies

Creating the DataSource

Creating a model

Creating a user repository

Creating controller

Autowired repository

Getting the user list

Getting one user by ID

Inserting new user

Updating a user

Deleting a user

Seeing the output

Database of client-side application

Architecture components

Creating an Android app

Gradle information

Gradle dependencies

Creating entity

Creating the DAO

Creating the LiveData class

Creating a Room database

Populating the database

Implementing the repository

Creating the ViewModel

Creating new activity

Creating custom RecyclerView adapter

Implementing RecyclerView

Modifying main activity

Getting data from another activity

Adding XML layouts

Switching another activity

Run the app

Summary

Questions

Further reading

Concurrency

Technical requirements

Coroutines

Coroutine basics

Call stacks

Coroutine testing

Coroutine scope

Channels

The producer function

The actor function

Sequential operations

Callback hell

What is a callback?

Thread pools

Summary

Questions

Further reading

Reactive Programming

Technical requirements

Reactive programming with Spring Reactor

The Observer pattern

The Flux publisher

The filter operator

The map operator

The flatMap operator

The reduce operator

The from static method

Cancellation

The Mono publisher

Blocking and non-blocking

RxJava

Flowable

Observable

The debounce operator

The throttle operator

Single

Maybe

Completable

RxJava in Android

The RxAndroid library

The RxBinding library

Summary

Questions

Further reading

Creating an Application

Technical requirements

Project idea

Server side

Creating the design

Developing a database model

Creating a project

Creating entities

Creating a Profile entity

Creating a Post entity

Creating a Comment entity

Creating like entity

Creating repositories

Creating a controller

Creating a profile's HTTP requests

Creating a post's HTTP requests

Creating a comment's HTTP requests

Implementing security

Modified application.properties

Client side

Creating the design

Creating a project

Implementing dependencies

Creating HomeActivity

Modifying the layout

Creating models

Creating profile model

Creating post model

Creating a comment model

Creating services

Creating the profile service

Creating the post service

Creating the comment service

Creating an API service

Creating a login activity

Modifying the layout

Modifying activity

Login request

Creating the registration activity

Modifying layout

Modifying the activity

Registering a new profile

Modifying the main activity

Modifying the layout

Modifying the activity

Fetching a post

Submitting a post

Implementing the menu

Modifying the post adapter

Modifying post adapter layouts

Creating the adapter for posts

Modifying the profile layout

Modifying a profile activity

Fetching the profile details

Post details activity

Modifying the post details layout

Modifying the post details activity

Fetching post details

Submitting comment

Modifying the comment adapter

Checking the output

Summary

Questions

Further reading

Testing an Application

Technical requirements

Software testing

JUnit

Advantages of JUnit

Basic annotations of JUnit

Creating a project

Test a project using JUnit

Creating a test case for a Rest API

UI testing on Android

Espresso

Creating an application

Injecting dependencies

Modifying the application

Creating testing files

Summary

Questions

Further reading

Assessments

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部