Giter Club home page Giter Club logo

weathermp's Introduction

WeatherMP

Demo weather app with multiplatform network core.

Демо приложение погоды с кроссплатформенным сетевым слоем.

Coding multiplatform network layer using KMM and code-generation.

Usage

For correct building change path to your andoid sdk dir in file local.properties.

Чтобы сбилдить проект, пропишите путь к android sdk в файле local.properties.

Used:

Problem solution

  1. PROBLEM: OpenApi-Generator currently (as a publication day) not generates multiplatform kotlin code correctly: lots of calls are deprecated, you may see it here.

    openapi-generator generate -g kotlin -i [file].yaml --library multiplatform -o NetworkLayer

  2. Using moko-network sample am generate part of necessary code:

    • CityApi.kt

    • City.kt

    • Weather.kt

    • WeatherNewsList.kt

    PROBLEM: icerockdev's approach in moko-network is to generate code for multiplatform view model. My case is to write multiplatfrom network service.

  3. Using this article (special thanks to Anna Zharkova) and this project write a rest part of code:

    • Dispatcher.kt

    • WeatherApiService.kt

Решение:

  1. Проблема: OpenApi-Generator на текущий момент (на время публикации репозитория) корректно не генерирует код для мультиплатформенной библиотеки на Kotlin: много вызовов запрещены, сгенерированный код можете посмотреть здесь.

    openapi-generator generate -g kotlin -i [file].yaml --library multiplatform -o NetworkLayer

  2. Используя moko-network sample сгенерировал часть необходимого кода, в моем случае это:

    • CityApi.kt

    • City.kt

    • Weather.kt

    • WeatherNewsList.kt

    Проблема: подход icerockdev в moko-network - сгенерировать мультиплатформенный код для view model. В моем случае решил сделать сетевой сервис.

  3. Используя статью "Создаём своё первое приложение для Kotlin Multiplatform" (отдельное спасибо Анне Жарковой) и этот проект пишем оставшуюся часть кода:

    • Dispatcher.kt

    • WeatherApiService.kt

weathermp's People

Contributors

c-villain avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.