Cover......Page 1
Copyright and Credits......Page 3
Dedication......Page 4
Packt Upsell......Page 5
Contributors......Page 6
Table of Contents......Page 8
Preface......Page 15
Chapter 1: The Fundamentals......Page 20
Getting started with Kotlin......Page 21
Installation on Windows......Page 22
Installation on macOS......Page 23
Installing the command-line compiler on macOS......Page 24
MacPorts......Page 25
Installing the command-line compiler on Windows......Page 26
Running your first Kotlin program......Page 27
Using the REPL......Page 28
Working with an IDE......Page 29
Setting up a Kotlin project with IntelliJ......Page 30
Kotlin basics......Page 32
Variables......Page 33
Local variables......Page 34
Operands and operators......Page 35
Double......Page 36
Char ......Page 37
Array......Page 38
Declaring functions......Page 39
Invoking functions......Page 40
Return values......Page 41
Single-line comments......Page 42
Conditional expressions......Page 43
The when expression......Page 44
The Elvis operator......Page 45
The for loops......Page 46
The while loops......Page 47
The break and continue keywords......Page 48
The do…while loops......Page 49
The import keyword......Page 53
Introduction......Page 54
Working with classes......Page 55
Companion objects......Page 56
Advantages of Kotlin......Page 57
Developing Android applications with Kotlin......Page 58
Setting up Android Studio......Page 59
Building your first Android application......Page 62
Creating a user interface......Page 66
Running the application......Page 70
Fundamentals of the web......Page 73
Clients and servers......Page 74
HTTP methods......Page 75
Summary......Page 76
Chapter 2: Building an Android Application – Tetris......Page 77
Application components......Page 78
Intents......Page 79
Content providers......Page 80
Understanding Tetris......Page 81
Creating the user interface......Page 82
Implementing the layouts......Page 83
Margins......Page 85
Dimension constraints......Page 86
Defining dimension resources......Page 89
Views......Page 91
View groups......Page 92
Defining string resources......Page 97
Event listeners......Page 100
Working with SharedPreferences......Page 106
Implementing the game activity layout......Page 111
Structure of the app manifest file......Page 115
......Page 117
......Page 118
......Page 119
Summary......Page 120
Chapter 3: Implementing Tetris Logic and Functionality......Page 121
Implementing the Tetris gameplay......Page 122
Behaviors of a block......Page 123
Modeling block shape......Page 124
Private access modifier (private)......Page 134
Internal visibility modifier (internal)......Page 135
Creating the application model......Page 139
Creating TetrisView......Page 151
Implementing ViewHandler......Page 152
Implementing Dimension......Page 153
Implementing TetrisView......Page 154
Finishing up GameActivity......Page 157
Introduction to Model-View-Presenter (MVP)......Page 162
Presenter......Page 163
Summary......Page 164
Chapter 4: Designing and Implementing the Messenger Backend with Spring Boot 2.0......Page 165
REST......Page 166
Incremental development......Page 167
Use cases......Page 168
System behavior......Page 169
Implementing the messenger backend......Page 170
Windows installation......Page 171
Linux installation......Page 172
Creating a new Spring Boot application......Page 173
Getting familiar with Spring Boot......Page 176
Maven......Page 180
Creating models......Page 181
Creating repositories......Page 187
Services and service implementations......Page 188
Spring Security......Page 199
JSON Web Tokens......Page 200
Configuring web security......Page 201
Accessing server resources via RESTful endpoints......Page 207
Deploying the messenger API to AWS......Page 217
Setting up PostgreSQL on AWS......Page 218
Deploying the messenger API to Amazon Elastic Beanstalk......Page 222
Summary......Page 225
Chapter 5: Building the Messenger Android App – Part I......Page 226
Including project dependencies......Page 227
Developing the Login UI......Page 228
Creating the login view......Page 232
Storing data locally with SharedPreferences......Page 236
Creating value objects......Page 239
Communicating with a remote server......Page 240
Sending requests to a server with OkHttp......Page 241
Modeling request data......Page 242
Creating the Messenger API service......Page 243
Implementing data repositories......Page 247
Creating the login interactor......Page 250
Creating the login presenter......Page 254
Finishing the LoginView......Page 257
Developing the signup UI......Page 258
Creating the signup interactor......Page 260
Creating the signup presenter......Page 264
Creating the signup view......Page 266
Summary......Page 269
Chapter 6: Building the Messenger Android App – Part II......Page 270
Creating the MainView......Page 271
Creating the MainInteractor......Page 273
Creating the MainPresenter......Page 276
Wrapping up the MainView......Page 278
Creating the MainActivity menu......Page 289
Creating the chat layout......Page 290
Preparing chat UI models......Page 292
Creating the ChatInteractor and ChatPresenter......Page 293
Creating the application's settings activity......Page 300
Android application testing......Page 316
AsyncTask......Page 317
Summary......Page 318
Chapter 7: Storing Information in a Database......Page 319
Reading files from internal storage......Page 320
A sample application using internal storage......Page 321
Saving cached files......Page 335
Asserting media availability......Page 336
Storing sharable files......Page 337
Working with a SQLite database......Page 338
Working with content providers......Page 356
Summary......Page 367
Securing an Android application......Page 368
Using content providers......Page 369
Telephony networking......Page 370
Securing broadcast receivers......Page 371
Launching and publishing your Android application......Page 372
Preparing your Android developer account......Page 373
Building a release-ready application package (APK)......Page 374
Pricing and application distribution setup......Page 375
Publishing your application......Page 376
Signing your application for release......Page 381
Releasing your Android app......Page 385
Summary......Page 392
Chapter 9: Creating the Place Reviewer Backend with Spring......Page 393
The controller......Page 394
Use case identification......Page 395
Identifying data......Page 396
Implementing the backend......Page 397
Creating models......Page 400
Creating data repositories......Page 403
Place Reviewer business logic implementation......Page 404
Securing the Place Reviewer backend......Page 407
Serving web content with Spring MVC......Page 410
Generating logs with Spring......Page 413
Installing Elasticsearch......Page 414
Installing Logstash......Page 416
Configuring Kibana......Page 418
Summary......Page 421
Chapter 10: Implementing the Place Reviewer Frontend......Page 422
Creating views with Thymeleaf......Page 423
Implementing the user registration view......Page 424
Implementing the login view......Page 440
Setting up the Place Reviewer app with the Google Places API web service......Page 444
Getting an API key......Page 445
Implementing the home view......Page 447
Implementing the review creation web page......Page 459
Spring application testing......Page 472
Creating a configuration class......Page 473
Writing your first test......Page 474
Summary......Page 477
What next?......Page 478
Other Books You May Enjoy......Page 479
Index......Page 482