# Kotlin Delegated Properties for Designing a Simple Android Library API

DevFeed: [Kotlin Delegated Properties for Designing a Simple Android Library API](<https://devfeed.tech/articles/delightful-delegate-design-27043.md>)

Original publisher: [Read original article](<https://web.archive.org/web/20200513142755/https://blog.autsoft.hu/delightful-delegate-design/>)

Author: Márton Braun

Published: 2019-04-11T19:00:00Z

Content type: tutorial

Language: en

Sources: [zsmb.co](<https://devfeed.tech/sources/zsmb-co.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Library](<https://devfeed.tech/topics/library.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Android](<https://devfeed.tech/topics/android.md>), [properties](<https://devfeed.tech/topics/properties.md>), [factory function](<https://devfeed.tech/topics/factory-function.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [api-design](<https://devfeed.tech/tags/api-design.md>), [delegates](<https://devfeed.tech/tags/delegates.md>), [factory-function](<https://devfeed.tech/tags/factory-function.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [library](<https://devfeed.tech/tags/library.md>), [properties](<https://devfeed.tech/tags/properties.md>)

## AI overview

This tutorial explains API design choices in the Krate Android SharedPreferences wrapper. It shows how Kotlin delegated properties can encapsulate reusable logic, persist values across application restarts, and hide concrete implementations behind a simple interface and factory function.

## Source excerpt

When developing a library, designing an easy to use API while hiding unnecessary implementation details from clients is fundamental. Let's look at some API design choices we've made for our library Krate, an Android SharedPreferences wrapper.