
Kotlin Blueprints
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Person
Ashish Belagali is an IIT Bombay alumnus with 24 years of experience in software technology, management, consulting, and client handling. He has successfully executed offshore engagements in both onsite and offshore roles. He is known as a turnaround specialist, having turned many IT projects from red to green in a short time. In spite of the senior positions he has handled, Ashish loves coding and has managed to stay hands-on with it. He often speaks about technology, entrepreneurship, and work effectiveness. He is a Kotlin enthusiast and has worked on several Kotlin projects. He is also the founder of the Kotlin Pune User Group.Chordiya Akshay :
Akshay Chordiya is the co-founder of BitFurther, an Android Developer by heart, and a Kotlin enthusiast. He has been working with Android for over 4 years. He is an active community speaker who is mostly found talking about Android and Kotlin. Akshay is an avid blogger and instructor. He has a love for anything with the word "technology" in it! The vision of bringing about a change in the world through his knowledge is what makes him get out of bed every day and work on his apps and his start-up. "Doing what you love" can be said to sum up his life until now and in the exciting years to come ahead!Trivedi Hardik :
Hardik Trivedi is a self-taught computer programmer. He has worked on Android and Java since 2010 and has immersed himself in Kotlin and JavaScript. Apart from client projects, he loves contributing back to the development community by spending time on Stack Overflow and writing tech blogs. Hardik also mentors college students, professionals, and companies are interested in mobile app development. He is also an active community speaker.
Content
- Cover
- Title Page
- Copyright
- Credits
- About the Authors
- Acknowledgments
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: The Power of Kotlin
- Kotlin - a better Java
- Why not other languages?
- Why Kotlin?
- Concise yet expressive code
- Enhanced robustness
- Excellent IDE support from day one
- Beyond being a better Java
- Kotlin is in the winning camp
- Go native strategy
- Kotlin's winning strategy
- Summary
- Chapter 2: Geospatial Messenger - Spring Boot
- Why Spring Boot?
- Leveraging Kotlin in Spring Boot applications
- Extension functions
- Constructor injection
- Leveraging Null safety
- Functional bean declaration DSL
- Let's build our geospatial messenger
- Preview
- Features
- Architecture
- Setting up the IDE
- Creating a project
- Project structure
- Setting up the build script
- Adding Kotlin dependency
- Adding Spring Boot dependencies
- Exposed library
- Gradle dependency
- Defining the table
- Connecting to the database
- CRUD operations
- Explaining PostGIS
- Installation
- Gradle dependency
- Object mapping
- Gradle dependency
- Completing the Gradle script
- Coding the application
- Frontend
- HTML
- CSS
- JavaScript
- Rendering the map
- Plotting messages on the map
- Listening to message saved events
- Complete JavaScript
- Application class
- Backend
- Application configuration
- Data classes
- Exposed integration
- Exposed objects
- Extras for geospatial support
- Service/Controller
- Repository
- CrudRepository
- Event broadcaster
- Extension functions
- Testing
- Gradle dependency
- Test cases
- Pro-tips
- All-open compiler plugin
- Spring starter
- Playing with the Java to Kotlin converter
- Migrating to Kotlin
- Should I rewrite the existing Java code in Kotlin?
- What if I want to rewrite Java to Kotlin?
- Summary
- Chapter 3: Social Media Aggregator Android App
- Setting up Kotlin
- Setting up the Kotlin plugin for Android Studio
- Getting started
- Converting Java code to Kotlin code
- Creating a social media aggregator
- Using datatypes and conversion
- String interpolation
- String utility methods
- Classes
- Constructors
- Data classes
- Inheritance
- Singletons
- lateinit versus lazy initialization
- lateinit
- The lazy property
- Control flow
- The when() expression
- Getters and setters
- Declaring a property
- Interfaces
- Kotlin Android extension
- Ditching the findViewById() method
- View extensions
- Fragment LayoutInflater extension
- The Standard.kt function
- The with() function
- The apply() function
- The let() function
- Functions in Kotlin
- Single-expression function
- Inline function
- Default and named parameters
- Default parameter
- Named parameter
- Destructing declaration
- Android context
- Null-Safety
- Why Kotlin is called null-safe
- Safe call operator (?.)
- Elvis operator (?:)
- Force unwrap (!!)
- Smart casts
- The is and !is operators
- The as operator
- Companion object
- Fragment instantiation using companion objects
- Dealing with constants
- Object expressions and declarations
- Delegated properties
- Dealing with Shared Preferences
- Setting up an item click on RecyclerView
- Anko - Kotlin's buddy for Android
- Setting up Anko
- Displaying toast()
- Starting an activity made easy
- Anko layout
- Summary
- Chapter 4: Weather App Using Kotlin for JavaScript
- Creating your first Kotlin and JavaScript project
- Choosing an IDE
- Creating a project
- Creating an HTML page
- Creating a Main.kt file
- Running the project
- Developing a weather forecast web app
- Creating a UI with dummy data
- Simple HTML approach
- Creating UI using Kotlin
- What is DSL?
- Using Kotlinx.html
- Refactoring the HTML code using DSL
- Calling a weather API
- Reading data from input elements
- Data classes
- Showing data to the user
- Showing weather details
- Named parameters
- Extension functions
- Giving final touches
- Adding CSS
- Interoperability with JavaScript
- Summary
- Chapter 5: Chat Application with Server-Side JavaScript Generation
- Creating our first Node.js app using Kotlin
- Choosing an IDE
- Installing Node.js
- Installing the Node.js plugin
- Creating a project
- Creating a chat application
- Setting up the Node.js server
- Specifying the output files
- Examining the compilation output
- Specifying the router
- Starting the node server
- Creating a login page
- Creating an index.ejs file
- Using DSL
- Using kotlinx.html
- Lambda functions
- Reading the nickname
- Passing nickname to the server
- Smart cast
- Registering a callback
- Establishing a socket connection
- Setting up Socket.IO
- Listening to events
- Emitting the event
- Incrementing and decrementing operator overloading
- Showing a list of online users
- Using the data class
- Using the Pair class
- Iterating list
- Sending and receiving a message
- Null safety
- Force unwraps
- Using the let function
- Named parameter
- Disconnecting a socket
- Styling the page using CSS
- Summary
- Chapter 6: News Feed - REST API
- What is REST?
- What is Ktor?
- Why Ktor?
- Understanding unopinionated applications
- Asynchronous nature
- Highly testable
- Deploying the Ktor app
- Let's build our news application
- News provider
- Fetching news sources
- Fetching news articles
- Preview
- Features
- Architecture
- Setting up the IDE
- Prerequisites
- Creating the project
- Project structure
- Deploying
- Deploying in IntelliJ IDEA
- Setting up the build script
- Adding Kotlin dependency
- Adding Ktor dependencies
- Configuring logging
- Adding Fuel
- What is Fuel?
- Adding Gradle dependency
- Quick sample
- Asynchronous mode
- Blocking mode
- Completing Gradle script
- Let's code!
- Application configuration
- Deployment block
- Application block
- Application main
- Installing routing
- Simple routing
- Modular routing
- Understanding route paths
- Path parameters
- Testing
- Adding Gradle dependency
- Testing the application
- Testing the index URL
- Testing JSON using Postman
- Testing news sources using Postman
- Testing news sources using Postman
- Summary
- Chapter 7: CSV Reader in Kotlin Native
- What is Kotlin Native?
- Target platforms
- Multiplatform Kotlin
- Installing Kotlin Native
- Installing from the source
- Installing from binaries
- Testing the installation
- Memory management
- Building our app
- Writing the main function
- Reading command-line arguments
- Opening the file
- Reading the file contents
- Counting unique entries
- Converting to Kotlin string
- Splitting strings
- Printing the result
- Complete code
- Running the program
- Understanding the dataset
- Compiling the program
- Executing the program
- Multiplatform Kotlin
- Project structure
- Common module
- Platform module
- Regular module
- Overview of the dependency structure
- Setting up a multiplatform project
- Creating a multiplatform project with an IDE
- Creating a multiplatform project without an IDE
- Summary
- Chapter 8: Dictionary Desktop Application - TornadoFX
- Introducing TornadoFX
- Java-based desktop frameworks
- TornadoFX special additions
- Creating a type-safe UI versus FXML
- Type-safe styling
- Other improvements
- Let's build our dictionary application
- What we will build
- Words API
- Definition API
- Features of our application
- Setting up the IDE
- Prerequisites
- Installing the TornadoFX plugin
- Creating the project
- Project structure
- Let's code!
- Application class
- Type-safe CSS
- Dependency injection
- Property delegate
- Consuming the REST API
- Defining the Model
- Implementing the JSONModel interface
- REST client
- Configuring the client
- Controllers
- Views
- Layouts
- VBox layout
- HBox layout
- Other layouts
- Forms
- Background operations
- Printing the result
- Complete View
- Launching the application
- Summary
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.