目錄(234章)
倒序
- cover
- Title Page
- Copyrights
- Android Development with Kotlin
- Credits
- About the Authors
- About the Reviewers
- www.PacktPub.com
- Why subscribe?
- Customer Feedback
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Errata
- Piracy
- Questions
- Beginning Your Kotlin Adventure
- Say hello to Kotlin
- Awesome Kotlin examples
- Dealing with Kotlin code
- Kotlin Playground
- Android Studio
- Configuring Kotlin for the project
- Using Kotlin in a new Android project
- Java to Kotlin converter (J2K)
- Alternative ways to run Kotlin code
- Kotlin under the hood
- The Kotlin standard library
- More reasons to use Kotlin
- Summary
- Laying a Foundation
- Variables
- Type inference
- Strict null safety
- Safe call
- Elvis operator
- Not-null assertion
- The let function
- Nullability and Java
- Casts
- Safe/unsafe cast operator
- Smart casts
- Type smart casts
- Non-nullable smart cast
- Primitive data types
- Numbers
- Char
- Arrays
- The Boolean type
- Composite data types
- Strings
- String templates
- Ranges
- Collections
- Statements versus expressions
- Control flow
- The if statement
- The when expression
- Loops
- The for loop
- The while loop
- Other iterations
- Break and continue
- Exceptions
- The try... catch block
- Compile-time constants
- Delegates
- Summary
- Playing with Functions
- Basic function declaration and usage
- Parameters
- Returning functions
- Vararg parameter
- Single-expression functions
- Tail-recursive functions
- Different ways of calling a function
- Default argument values
- Named arguments syntax
- Top-level functions
- Top-level functions under the hood
- Local functions
- Nothing return type
- Summary
- Classes and Objects
- Classes
- Class declaration
- Properties
- Read-write versus read-only
- Property access syntax between Kotlin and Java
- Increment and decrement operators
- Custom getters/setters
- The getter versus property default value
- Late-initialized properties
- Annotating properties
- Inline properties
- Constructors
- Properties versus constructor parameters
- Constructors with default arguments
- Patterns
- Inheritance
- The JvmOverloads annotation
- Interfaces
- Data classes
- The equals and hashCode methods
- The toString method
- The copy method
- Destructing declarations
- Operator overloading
- Object declaration
- Object expression
- Companion objects
- Companion object instantiation
- Enum classes
- Infix calls for named methods
- Visibility modifiers
- The internal modifier and Java bytecode
- Sealed classes
- Nested classes
- Import aliases
- Summary
- Functions as First-Class Citizens
- Function types
- What is function type under the hood?
- Anonymous functions
- Lambda expressions
- The implicit name of a single parameter
- Higher-order functions
- Providing operations to functions
- Observer (Listener) pattern
- A callback after a threaded operation
- Combination of named arguments and lambda expressions
- The last lambda in an argument convention
- Named code surrounding
- Processing data structures using LINQ style
- Java SAM support in Kotlin
- Named Kotlin function types
- Named parameters in function types
- Type alias
- Underscore for unused variables
- Destructuring in lambda expressions
- Inline functions
- The noinline modifier
- Non-local returns
- Labeled returns in lambda expressions
- Crossinline modifier
- Inline properties
- Function references
- Summary
- Generics Are Your Friends
- Generics
- The need for generics
- Type parameters versus type arguments
- Generic constraints
- Nullability
- Variance
- Variance modifiers
- Use-site variance versus declaration-site variance
- Collection variance
- Variance producer/consumer limitation
- Invariant constructor
- Type erasure
- Reified type parameters
- The startActivity method
- Star-projections
- Type parameter naming convention
- Summary
- Extension Functions and Properties
- Extension functions
- Extension functions under the hood
- No method overriding
- Access to receiver elements
- Extensions are resolved statically
- Companion object extensions
- Operator overloading using extension functions
- Where should top-level extension functions be used?
- Extension properties
- Where should extension properties be used?
- Member extension functions and properties
- Types of receivers
- Member extension functions and properties under the hood
- Generic extension functions
- Collection processing
- The Kotlin collection type hierarchy
- The map filter and flatMap functions
- The forEach and onEach functions
- The withIndex and indexed variants
- The sum count min max and sorted functions
- Other stream processing functions
- Examples of stream collection processing
- Sequence
- Function literals with a receiver
- Kotlin standard library functions
- The let function
- Using the apply function for initialization
- The also function
- The run and with functions
- The to function
- Domain-specific language
- Anko
- Summary
- Delegates
- Class delegation
- The Delegation pattern
- Decorator pattern
- Property delegation
- What are delegated properties?
- Predefined delegates
- The lazy function
- The notNull function
- The observable delegate
- The vetoable delegate
- Property delegation to the Map type
- Custom delegates
- View binging
- Preference binding
- Providing a delegate
- Summary
- Making Your Marvel Gallery Application
- Marvel Gallery
- How to use this chapter
- Making an empty project
- Character gallery
- View implementation
- Network definition
- Business logic implementation
- Putting it all together
- Character search
- Character profile display
- Summary 更新時間:2021-07-02 18:49:08
推薦閱讀
- Getting Started with Gulp(Second Edition)
- Implementing Modern DevOps
- C語言程序設(shè)計實踐教程(第2版)
- Android應(yīng)用程序開發(fā)與典型案例
- Learn to Create WordPress Themes by Building 5 Projects
- MATLAB 2020 從入門到精通
- Data Analysis with Stata
- Java網(wǎng)絡(luò)編程實戰(zhàn)
- Java語言程序設(shè)計教程
- 快速入門與進階:Creo 4·0全實例精講
- Fast Data Processing with Spark(Second Edition)
- Python Programming for Arduino
- Flutter從0基礎(chǔ)到App上線
- JavaScript語法簡明手冊
- Python自動化運維:技術(shù)與最佳實踐
- 編程改變生活:用PySide6/PyQt6創(chuàng)建GUI程序(進階篇·微課視頻版)
- AngularJS Directives Cookbook
- Learning Java by Building Android Games
- PHP7實踐指南:O2O網(wǎng)站與App后臺開發(fā)
- ANSYS Workbench有限元分析實例詳解(靜力學(xué))
- Learning Highcharts 4
- Mastering Grunt
- Visual FoxPro程序設(shè)計實踐教程(第3版)
- Figma UI設(shè)計技法與思維全解析
- Mastering FreeSWITCH
- 32位匯編語言程序設(shè)計(第3版)
- 深入淺出:.NET框架設(shè)計與實現(xiàn)
- HTML5 Data and Services Cookbook
- Kafka入門與實踐
- 使用Struts搭建MVC模式商業(yè)應(yīng)用(藍橋杯軟件大賽培訓(xùn)教材-Java方向)