Android News Reader app. Kotlin Coroutines, Retrofit and Realm

Overview

News Reader

Android News Reader app

Code that follows Packt Publishing Kotlin in Practice Video Course

Example of Kotlin Coroutine usage, with Realm and Retrofit.

Most of the code in the Master branch is by now out of date. For example, Kotlin Coroutines are now stable and have a slightly different API. The master branch is not updated, because it follows the code from the course.

Kotlin_1.3 Branch is updated to Kotlin 1.3 and Coroutines 1.0.

There is also a RxJava branch that uses RxJava for Async and Reactive programming.

To make the project compile, you need to get an API key from NewsApi.org and put it into your local gradle.properties file under the key NEWS_READER_API_KEY

Written by Marko Devcic

License: MIT

You might also like...
📱:newspaper: Android client for the Nextcloud news/feed reader app
📱:newspaper: Android client for the Nextcloud news/feed reader app

Nextcloud News Reader – Android App The Nextcloud News Reader Android App is under AGPLv3 License terms. Bugs and enhancements can be reported under:

Anxiety free news reader for Android - developed using Kotlin

Android River is a modern Android 2.2 news app. It's now version 1.15. Android River has the following features: Read RSS 1.0, RSS 2.0 and ATOM 1.0. C

Readow - Readow RSS Reader application. It’s fast and clean, giving you the freedom to enjoy your favorite news
Readow - Readow RSS Reader application. It’s fast and clean, giving you the freedom to enjoy your favorite news

Readow Readow RSS Reader application. It’s fast and clean, giving you the freedo

NewsFeedApp - An android news-feed-app which shows latest news of various sources
NewsFeedApp - An android news-feed-app which shows latest news of various sources

NewsFeedApp An android news-feed-app which shows latest news of various sources

Newesy is news app which uses NewsAPI to fetch news.
Newesy is news app which uses NewsAPI to fetch news.

Newesy is news app which uses NewsAPI to fetch news.The main aim of this app was to learn Modern Android Architecture (MVVM).It uses MVVM,Kotlin-coroutines,Room,ViewModal,Retrofit,GSON and Navigation graph

This is a News Application for android mobiles, fetching news through Guardian API.
This is a News Application for android mobiles, fetching news through Guardian API.

News-In-Hand This is a NEWS FEED APP which gives a user regularly-updated news from the Internet. To achieve this, I use the Guardian API. This is a w

Android native news App using API from thenewsapi.com and Retrofit Library
Android native news App using API from thenewsapi.com and Retrofit Library

FlashBytes-Android-News-App Android Material Design News App using API from https://www.thenewsapi.com/ and Retrofit Library Screen Splash, Onboard Sc

It is a NBAApp developed by Kotlin. It uses MVVM design pattern, Coroutines, Retrofit and JetPack libraries like Room, Lifecycle, ViewBinding, DataBinding, Hilt and Navigation.
It is a NBAApp developed by Kotlin. It uses MVVM design pattern, Coroutines, Retrofit and JetPack libraries like Room, Lifecycle, ViewBinding, DataBinding, Hilt and Navigation.

NbaApp It is a NBAApp developed by Kotlin. It uses MVVM design pattern, Coroutines, Retrofit and JetPack libraries like Room, Lifecycle, ViewBinding,

MVVM + Kotlin + Jetpack Compose +Navigation Compose + Hilt + Retrofit + Unit Testing + Compose Testing + Coroutines + Kotlin Flow + Io mockK
MVVM + Kotlin + Jetpack Compose +Navigation Compose + Hilt + Retrofit + Unit Testing + Compose Testing + Coroutines + Kotlin Flow + Io mockK

MvvmKotlinJetpackCompose Why do we need an architecture even when you can make an app without it? let's say you created a project without any architec

Comments
  • async from kotlinx.coroutines.experimental.asyn OBSOLETE

    async from kotlinx.coroutines.experimental.asyn OBSOLETE

    Hi @deva666,

    we are doing Kotlin in Practice course from Safari Books, we have notate that async used in file RetrofitExtensions it's obsolete.

    Could you bring a solution? we have seen that you might have to do a migration to 1.3 versions of this implementations -> implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.19' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.19'

    You will find the problem in this line -> fun <T> Call<T>.launchAsync(): Deferred<T> = async{[email protected]().body()!!}

    opened by lauramsolana93 4
  • problem while running

    problem while running

    e: E:\NewsReader-master\app\build\generated\source\buildConfig\debug\com\markodevcic\newsreader\BuildConfig.java:14: error: ';' expected e:

    e: public static final String NEWS_READER_API_KEY = 1f75169ca6fe4f6c9475024e2d9c608a; e: ^ e: E:\NewsReader-master\app\build\generated\source\buildConfig\debug\com\markodevcic\newsreader\BuildConfig.java:14: error: expected e:

    e: public static final String NEWS_READER_API_KEY = 1f75169ca6fe4f6c9475024e2d9c608a; e: ^ e: E:\NewsReader-master\app\build\generated\source\buildConfig\debug\com\markodevcic\newsreader\BuildConfig.java:14: error: cannot find symbol e:

    e: public static final String NEWS_READER_API_KEY = 1f75169ca6fe4f6c9475024e2d9c608a; e: ^ e: symbol: class ca6fe4f6c9475024e2d9c608a e: location: class BuildConfig e: java.lang.IllegalStateException: failed to analyze: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:138) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:58) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:103) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92) at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$2.invoke(CompileServiceImpl.kt:386) at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$2.invoke(CompileServiceImpl.kt:96) at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:889) at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:96) at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137) at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:916) at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:888) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:385) at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:90) at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:42) at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:205) at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:166) at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:82) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:96) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:106) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:83) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:377) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:68) at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:96) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:368) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:133) ... 29 more

    FAILED :app:buildInfoGeneratorDebug

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:kaptDebugKotlin'.

    Internal compiler error. See log for more details

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 2s

    opened by ELTEGANI 2
Owner
Marko Devcic
Software developer by day. By night, also a software developer. Author of Kotlin Quick Start Guide by Packt Publishing
Marko Devcic
Android News App built in kotlin with implementation of MVVM architecture, android navigation components and retrofit. Displays news to users allowing them to share and save news.

News-App Android news app built in kotlin that fetches news data from news api with Retrofit and displays news to users. This App follow MVVM architec

Raj Manjrekar 16 Dec 29, 2022
The News App has been carried out within the framework of the MVVM architecture, information about news is obtained by consulting an API, it is built usisng Jetpack Copose, Coroutines, Dependency Injection with Hilt and Retrofit

Journalist The News App consists of an application that displays the latest news from EEUU from an API that provides official and updated information.

null 0 Nov 3, 2021
Flym News Reader is a light Android feed reader (RSS/Atom)

BEWARE: Google added some restrictions to news app and I don't see how Flym (and other RSS aggregators) could comply to that. For instance, Flym canno

Frédéric Julian 938 Jan 1, 2023
Flym News Reader is a light Android feed reader (RSS/Atom)

BEWARE: Google added some restrictions to news app and I don't see how Flym (and other RSS aggregators) could comply to that. For instance, Flym canno

Frédéric Julian 938 Jan 1, 2023
Flym News Reader is a light Android feed reader (RSS/Atom)

BEWARE: The original developer stopped the development of the app so I'm starting to work on it to improve it and maintain it. Flym News Reader Light

null 0 Jul 26, 2022
News-App - A news app Which displays news with the help of JSON data

News-App This is a news app Which displays news with the help of JSON data

Lalith Sharma 0 Feb 16, 2022
A news app made using android studio in Java with features like favourite news, Location detector for local news, and especially made with HUAWEI APIs

HuaweiGlobalNewsApp A news app made using android studio in Java with features like favourite news, Location detector for local news, and especially m

Christian Imanuel Hadiwidjaja 1 Oct 30, 2021
A News Application Shows Breaking News of the Country with a feature to save News for future Use.

A News Application Shows Breaking News of the Country with a feature to save News for future Use.You can search news on any topic.Used all latest stuffs in android like Navigation Component, MVVM Architecture, Retrofit, Room DataBase, Kotlin Corutines etc

Aman Bhatt 2 Oct 20, 2022
Sample news app using Kotlin, Hilt, Coroutines, Coil, Room, Retrofit

Tech stack & News App libraries Navigation component - navigation graph for navigating and replacing screens/fragments DataBinding - allows to more ea

Mina Mikhail 3 Dec 28, 2021
📱:newspaper: Android client for the Nextcloud news/feed reader app

Nextcloud News Reader – Android App The Nextcloud News Reader Android App is under AGPLv3 License terms. Bugs and enhancements can be reported under:

Nextcloud 589 Dec 31, 2022