Skip to content

Latest commit

 

History

History
87 lines (80 loc) · 4.32 KB

File metadata and controls

87 lines (80 loc) · 4.32 KB

The Purpose

How?

  • Create sample codes derived from Google Official Training
  • Add some boilerplate code for practicing and examination

Kotlin

  • Java to Kotlin
    • The annotation such as @Nullable, helps the convert to the appropriated declaration.
    • Equality
    • Default arguments, named arguments
    • Destructuring
    • Elvis operator
    • string templates
    • With Kotlin, we prefer using properties rather than functions for such cases.
    • top-level functions
    • Scope functions: let, apply, with, run, also
  • Ready to get the certificate from Add Kotlin to an existing app
    • How to create Java/Kotlin files
    • Source organization
    • Code conversion and nullability
    • lateinit
    • safe-call (?.) v.s elvis operator (?:)
  • Calling Kotlin codes from Java
    • The @JvmStatic annotation tells the Kotlin compiler to generate a static version of the annotated member or method
    • The @JvmName annotation is a powerful tool that influences how Kotlin names classes, properties, and methods in the bytecode it generates for the Java Virtual Machine (JVM). We'll discuss another of its uses later in this codelab.
    • @JvmStatic @Throws(IOException::class)
  • Kotlin-Java interop guide
    • No hard keywords, backticks
    • Nullability annotations
    • Lambda parameters last
    • Property prefixes
      • is, set, get
    • Operator overloading
    • Defensive copies
    • Function overloads for defaults
    • Lint: File > Preferences > Editor > Inspections

Android Components

  • Navigation
  • ViewModel
  • Asynchronous
    • Thread
    • Coroutine
      • runBlocking
      • lifecycleScope.launch
  • LiveData & FlowData
  • WorkManager
  • DataStore

Unit 1: Kotlin basics

Unit 2: Layouts

Unit 3: Navigation

  • Kotlin Collection, Map, Set, List etc, and how use the high-level function
  • ViewModel, Kotlin Delegate, Get() / Set(), backing property
  • MaterialAlertDialogBuilder

Unit 4: Connect to the internet

Unit 5: Data persistence

  • SQL basics
    • SQL data types, Aggregate functions
  • ROOM/DAO/SQLite db

Unit 6: WorkManager

Tips