| name | fundamentals |
| description | Master Kotlin syntax, OOP principles, SOLID practices, functional programming, and data structures. |
| version | 2.0.0 |
| sasmp_version | 1.3.0 |
| bonded_agent | 01-android-fundamentals |
| bond_type | PRIMARY_BOND |
| atomic | true |
| single_responsibility | Kotlin & OOP fundamentals |
| parameters | {"topic":{"type":"string","enum":["kotlin","oop","solid","functional","collections"],"required":false},"code_context":{"type":"string","required":false}} |
| retry | {"max_attempts":2,"backoff":"exponential","on_failure":"return_basic_example"} |
| logging | {"level":"info","include":["query","response_time","errors"]} |
Kotlin Fundamentals Skill
Quick Start
val immutable = "constant"
var mutable = "variable"
fun greet(name: String): String = "Hello, $name"
data class User(val id: Int, val name: String)
val user: User? = null
user?.name
user?.name ?: "Unknown"
Key Concepts
Null Safety
? for nullable types
!! for non-null assertion (avoid)
?: elvis operator for defaults
?.let { } for null-safe blocks
Extension Functions
fun String.isValidEmail(): Boolean = contains("@")
val valid = "user@example.com".isValidEmail()
Scope Functions
apply: Configure object
let: Transform
run: Execute with context
with: Receiver operations
also: Side effects
Coroutines
viewModelScope.launch {
= withContext(Dispatchers.IO) {
fetchData()
}
}