Posts

Showing posts from April, 2021

Ktor for Mobile Developers: Is it Easy to Learn Server Side Coding? Part-2

Image
As you already check out my previous post about What is Ktor Framework? and How to get started?. In case of you didn’t please read this   Ktor for Mobile Developers: Is it Easy to Learn Server Side Coding? Part-1 . So lets get deep dive into Ktor Framework and start solve some real world complex problem. I am assuming you already created basic structure project. In this section we are going to learn how to send response or accept the request in Json format. For Json parsing  w e are using Jackson library. To install Json library add gradle dependency in ur build.gradle file. implementation "io.ktor:ktor-jackson:$ktor_version" Now install Jackson as  ContentNegotiation  library in  Application.module . install (ContentNegotiation) { jackson { enable(SerializationFeature. INDENT_OUTPUT ) } } In next step we are going to create Data Model class that will convert into Json structure and send it as response. @JsonIgnoreProperties(ignoreUnknown = true) data class U

Ktor for Mobile Developers: Is it Easy to Learn Server Side Coding? Part-1

Image
To create your first simple Ktor application we are going to use Ktor Framework. Ktor can be used to create a variety of server and client-side applications. I am assuming you already have installed IntelliJ IDEA Software in your system. In this section, we’re going to cover the basics of what a Ktor Server Application is and how the pieces all fit together. Ktor is an asynchronous framework for creating microservices, web applications, and more. It’s fun, free, and open source. Why Ktor?? There is following main features of Ktor Framework : 1. Lightweight: Use what you need. Ktor allows you to transparently configure only the functionality your project requires. No magic involved! 2. Extensible: Extend  w hat you need. With a configurable pipeline, you can create the extensions you need and place them anywhere you want. 3. Multiplatform: Run it where you need it. Built from the ground up with Kotlin Multiplatform technology, you can deploy Ktor applications anywhere. 4. Asynchronous: