Skip to content

A playground to gain a wider and deeper knowledge of the libraries in the Kotlin ecosystem. Also the official sample for gradle refreshVersions.

License

Notifications You must be signed in to change notification settings

dustinsand/kotlin-libraries-playground

 
 

Repository files navigation

Kotlin Libraries Playground

A playground to gain a wider and deeper knowledge of the libraries in the Kotlin ecosystem

Also the official sample for gradle refreshVersions

❤️ Contributors welcome! #hacktoberfest

We want to collect sample usage of Kotlin libraries, and the more the better!

You are very welcome to contribute your own library sample.

==> CONTRIBUTING.md

🤔How do you keep up with all the new stuff?

There are great resources to learn Kotlin.

But once you master the language, you are not done just yet.

You now face another challenging task: become familiar with its ecosystem of libraries.

With time, you want to both acquire:

  • a wider knowledge of what good libraries are available in the ecosystem in general
  • a deeper knowledge of some specific libraries particulary important for you

There are several inefficient ways to do that:

  • reading tutorial after tutorial and being stuck in a loop where you "learn" about things you don't practice
  • starting a new project from scratch for every libraries you come around - overwhelming
  • trying out the library in your main project at work - a project with a compilation time of 5 minutes, who uses an older version of the library than the tutorial assumes ; not sure your colleagues will be happy that you introduce a dependency you don't yet master.

🦅Widening your knowledge of libraries

The kotlin-libraries-playgound contains samples for a growing number of good Kotlin libraries including Moshi, Okio, OkHttp, Retrofit, Kotlinx Serialization, Ktor-client, ..., KoTest, Mockk, Spek, Strikt, Mockito, Junit-Jupiter, ... ...

You are very welcome to contribute new samples (see contributing section below).

For each library, we have a sample usage that is:

  • self-contained (own package and main function, usually one file)
  • simple, yet meaningful (no fancy coffee machine with termosiphon)

Here is for example the sample usage for kotlinx.serialization

package playground.kotlinx.serialization

fun main() {
    println("# Kotlin/kotlinx.serialization : Kotlin multiplatform / multi-format serialization")
    val user = User(name = "Robert", age = 42)
    val json = """{"name":"Robert","age":42}"""

    Json.encodeToString(user) shouldBe json
    Json.decodeFromString<User>(json) shouldBe user
}

@Serializable
internal data class User(
    val name: String,
    val age: Int
)

🔭 Deepening your understanding of one library

Clone this repository and make it yours.

Want to learn more about, say, OkHttp?

You don't have the hassle to create a new project.

Create a new branch called okhttp and try out things while you are reading the documentation

🎩 Easy dependency management with gradle refreshVersions

This playground is also the official sample for gradle refreshVersions

It makes it super easy to refresh dependencies

And to add a new dependency

About

A playground to gain a wider and deeper knowledge of the libraries in the Kotlin ecosystem. Also the official sample for gradle refreshVersions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 93.8%
  • HTML 6.2%