Giter VIP home page Giter VIP logo

kotlin-libraries-playground's Introduction

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

kotlin-libraries-playground's People

Contributors

jmfayard avatar louiscad avatar dector avatar ch8n avatar darthbenro008 avatar jaspervhaastert avatar lpicanco avatar mrclsu avatar sharkaboi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.