万本电子书0元读

万本电子书0元读

顶部广告

Kotlin Programming By Example电子书

售       价:¥

8人正在读 | 0人评论 9.8

作       者:Iyanu Adelekan

出  版  社:Packt Publishing

出版时间:2018-03-28

字       数:59.0万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Enhance your Kotlin programming skills by building 3 real-world applications About This Book ? Build three full-fledged, engaging applications from scratch and learn to deploy them ? Enhance your app development and programming activities with Kotlin’s powerful and intuitive tools and utilities. ? Experience the gentle learning curve, expressiveness, and intuitiveness of Kotlin, as you develop your own applications Who This Book Is For This book is for those who are new to Kotlin or are familiar with the basics, having dabbled with Java until now. Basic programming knowledge is mandatory. What You Will Learn ? Learn the building blocks of the Kotlin programming language ? Develop powerful RESTful microservices for Android applications ? Create reactive Android applications efficiently ? Implement an MVC architecture pattern and dependency management using Kotlin ? Centralize, transform, and stash data with Logstash ? Secure applications using Spring Security ? Deploy Kotlin microservices to AWS and Android applications to the Play Store In Detail Kotlin greatly reduces the verbosity of source code. With Google having announced their support for Kotlin as a first-class language for writing Android apps, now's the time learn how to create apps from scratch with Kotlin Kotlin Programming By Example takes you through the building blocks of Kotlin, such as functions and classes. You’ll explore various features of Kotlin by building three applications of varying complexity. For a quick start to Android development, we look at building a classic game, Tetris, and elaborate on object-oriented programming in Kotlin. Our next application will be a messenger app, a level up in terms of complexity. Before moving onto the third app, we take a look at data persistent methods, helping us learn about the storage and retrieval of useful applications. Our final app is a place reviewer: a web application that will make use of the Google Maps API and Place Picker. By the end of this book, you will have gained experience of of creating and deploying Android applications using Kotlin. Style and approach Here we will build three exciting projects in Kotlin which will demonstrate how to effectively use Kotlin language constructs
目录展开

Title Page

Copyright and Credits

Kotlin Programming By Example

Dedication

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewer

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

The Fundamentals

Getting started with Kotlin

JDK installation

Installation on Windows

Installation on macOS

Installation on Linux

Compiling Kotlin programs

Working with the command-line compiler

Installing the command-line compiler on macOS

Homebrew

MacPorts

Installing the command-line compiler on Linux

SDKMAN!

Installing the command-line compiler on Windows

Running your first Kotlin program

Writing scripts with Kotlin

Using the REPL

Working with an IDE

Installing IntelliJ IDEA

Setting up a Kotlin project with IntelliJ

The fundamentals of the Kotlin programming language

Kotlin basics

Variables

Variable scope

Local variables

Operands and operators

Types

Int

Float

Double

Boolean

String

Char

Array

Functions

Declaring functions

Invoking functions

Return values

The function naming convention

Comments

Single-line comments

Multiline comments

Doc comments

Controlling program flow

Conditional expressions

The if expression

The when expression

The Elvis operator

Loops

The for loops

The while loops

The break and continue keywords

The do…while loops

Packages

The import keyword

Object-oriented programming concepts

Introduction

Working with classes

Creating objects

Companion objects

Properties

Advantages of Kotlin

Developing Android applications with Kotlin

Setting up Android Studio

Building your first Android application

Creating a user interface

Running the application

Fundamentals of the web

What is the web?

Hypertext Transfer Protocol

Clients and servers

HTTP requests and responses

HTTP methods

Summary

Building an Android Application – Tetris

Android – an overview

Application components

Activities

Intents

Intent filters

Fragments

Services

Loaders

Content providers

Understanding Tetris

Creating the user interface

Implementing the layouts

ConstraintLayout

Margins

Chains

Dimension constraints

Defining dimension resources

Views

View groups

Defining string resources

Handling input events

Event listeners

Working with SharedPreferences

Implementing the game activity layout

The app manifest

Structure of the app manifest file

<action>

<activity>

<application>

<category>

<intent-filter>

<manifest>

Summary

Implementing Tetris Logic and Functionality

Implementing the Tetris gameplay

Modeling a tetromino

Characteristics of a block

Behaviors of a block

Modeling block shape

Private access modifier (private)

Public access modifier (public)

Protected access modifier (protected)

Internal visibility modifier (internal)

Creating the application model

Creating TetrisView

Implementing ViewHandler

Implementing Dimension

Implementing TetrisView

Finishing up GameActivity

Introduction to Model-View-Presenter (MVP)

What is MVP?

Model

View

Presenter

Varying implementations of MVP

Summary

Designing and Implementing the Messenger Backend with Spring Boot 2.0

Designing the messenger API

Application programming interfaces

REST

Designing the messenger API system

Incremental development

Spring Boot

What the messenger system does

Use cases

System behavior

Identifying data

Implementing the messenger backend

PostgreSQL

Installing PostgreSQL

Windows installation

macOS installation

Linux installation

Creating a new Spring Boot application

Getting familiar with Spring Boot

Maven

Creating models

Creating repositories

Services and service implementations

Restricting API access

Spring Security

JSON Web Tokens

Configuring web security

Accessing server resources via RESTful endpoints

Deploying the messenger API to AWS

Setting up PostgreSQL on AWS

Deploying the messenger API to Amazon Elastic Beanstalk

Summary

Building the Messenger Android App – Part I

Developing the Messenger app

Including project dependencies

Developing the Login UI

Creating the login view

Creating the Messenger API service and data repositories

Storing data locally with SharedPreferences

Creating value objects

Retrieving remote data

Communicating with a remote server

Communicating with servers using OkHttp

Sending requests to a server with OkHttp

Modeling request data

Creating the Messenger API service

Implementing data repositories

Creating the login interactor

Creating the login presenter

Finishing the LoginView

Developing the signup UI

Creating the signup interactor

Creating the signup presenter

Creating the signup view

Summary

Building the Messenger Android App – Part II

Creating the Main UI

Creating the MainView

Creating the MainInteractor

Creating the MainPresenter

Wrapping up the MainView

Creating the MainActivity menu

Creating the Chat UI

Creating the chat layout

Preparing chat UI models

Creating the ChatInteractor and ChatPresenter

Creating the application's settings activity

Android application testing

Performing background operations

AsyncTask

IntentService

Summary

Storing Information in a Database

Working with internal storage

Writing files to internal storage

Reading files from internal storage

A sample application using internal storage

Saving cached files

Working with external storage

Getting external storage permission

Asserting media availability

Storing sharable files

Caching files with external storage

Network storage

Working with a SQLite database

Working with content providers

Summary

Securing and Deploying an Android App

Securing an Android application

Data storage

Using internal storage

Using external storage

Using content providers

Networking security considerations

IP networking

Telephony networking

Input validation

Working with user credentials

Code obfuscation

Securing broadcast receivers

Dynamically loading code

Securing services

Launching and publishing your Android application

Understanding the Android developer program policies

Preparing your Android developer account

Localization planning

Planning for simultaneous release

Testing against the quality guidelines

Building a release-ready application package (APK)

Planning your application's Play Store listing

Uploading your application package to the alpha or beta channel

Device compatibility definition

Pre-launch report assessment

Pricing and application distribution setup

Distribution option selection

In-app products and subscriptions setup

Determining your application's content rating

Publishing your application

Signing your application for release

Releasing your Android app

Summary

Creating the Place Reviewer Backend with Spring

The MVC design pattern

The model

The view

The controller

Designing and implementing the Place Reviewer backend

Use case identification

Identifying data

Setting up the database

Implementing the backend

Connecting the backend to Postgres

Creating models

Creating data repositories

Place Reviewer business logic implementation

Securing the Place Reviewer backend

Serving web content with Spring MVC

Managing Spring application logs with ELK

Generating logs with Spring

Installing Elasticsearch

Installing Kibana

Installing Logstash

Configuring Kibana

Summary

Implementing the Place Reviewer Frontend

Creating views with Thymeleaf

Implementing the user registration view

Implementing the login view

Setting up the Place Reviewer app with the Google Places API web service

Getting an API key

Including Google Places API in your web application

Implementing the home view

Implementing the review creation web page

Spring application testing

Adding necessary testing dependencies to the project

Creating a configuration class

Configuring a test class to use custom configuration

Writing your first test

Summary

What next?

Other Books You May Enjoy

Leave a review - let other readers know what you think

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部