Giter Club home page Giter Club logo

android-kotlin-clean-architecture's Introduction

Actions Status Kotlin Version AGP Gradle License

This repository holds 2 projects:

  • Sample Giphy App is a test Project that displays paginated trending GIFs from Giphy and also contains search functionality.

    • This small project is a good starting point to get an overview of what current frameworks, architectural decisions and testing amongst other things can be expected on the other project in this repository.
    • I always use this repo to try out new things, benchmark & also write about it.
  • Amiga App is a larger feature modularized project aimed at reinventing the todo-calendar-wellbeing concept.

    • Amiga is a digital wellbeing experiment.
  • Both projects are under active development & they both share some common modules like Views, Network, Resources and Cache.

My main objective is to achieve with the least amount of code RUDT principles which means that the code must be easy to:

  • Read
  • Update
  • Debug
  • Test (Unit & UI)

Personal project to try out things:

  • Clean Architecture approach (from a pure approach to a simplified feature modularized approach).
  • DI (Dagger 2, Koin & now Dagger Hilt)
  • Dependency-less, independent, simplified Navigation with reflection.
  • Dynamic Feature Modularized.
  • Easy to RUDT (read, update, debug & test).
  • Playground to try different architectures.
  • Playground to try different libraries/frameworks.

Discussions

Refer to the issues section: https://github.com/sanogueralorenzo/Android-Kotlin-Clean-Architecture/issues

Mentions

androidweekly androidweekly kotlinweekly androidweekly

Social Media

Twitter | Medium | LinkedIn

Articles

Clean Architecture Guide (with tested examples): Data Flow != Dependency Rule

The death of Presenters and the rise of ViewModels (AAC)

Intro to App Architecture

Intro to App Modularization

Official Kotlin Style Guide with Ktlint

Koin in Feature Modules Project

Detecting Kotlin Code Smells with Detekt

Moshi with Retrofit

Gradle Dependency Management with Kotlin (buildSrc)

License

Copyright 2020 Mario Sanoguera de Lorenzo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this project except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-kotlin-clean-architecture's People

Contributors

sanogueralorenzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-kotlin-clean-architecture's Issues

Instrumentation tests in Feature modules

Expected:

  • define Koin application and mock dependencies in test's @Before

What's happening:

  • Feature module's injectFeature() is crashing the test because of duplicate dependencies

I'm curious if you've faced this issue and how you've solved it. Thanks!

Cause: DefaultClassLoaderScope ... must be locked before it can be used to compute a classpath!

After updating gradle.property for the property org.gradle.configureondemand=true, it generate below error.

Cause: org.gradle.api.internal.initialization.DefaultClassLoaderScope@2c3c5fa9 must be locked before it can be used to compute a classpath!

It works when setting the value to false. In that case, the purpose for the property for the multimodule project won't get solved right?

I'm using Kotlin DSL with the same gradle wrapper version from the repository.
Also changed the java version from 8, 11 & 16 still it has the same error.

If it works with value true then how to resolve the above issue?

using .subscribeOn() and .observeOn() with the same thread

erro code

how to get code of error response

.subscribe(
                {
                    financialResult.setSuccess(it)
                    setLoading(false, "financialResult")
                },
                {

                    financialResult.setError**(it.code)**
                    setLoading(false, "financialResult")
                }
            )

Question about injectFeature function

Hi! I tried to use Koin library with multi-feature modules, however, I don't know how to load koin modules properly from each features. Finally, I saw your blog post and get how to load koin modules in feature. The differences is "injectFeature"(loadFeature by lazy). I tried to load modules directly

It works as I expected,but I don't know why it is working. So, could you explain for this?

This Library

// Application
class App: Application() {
    override fun onCreate() {
        super.onCreate()

        startKoin { androidContext(this) } // it seems deprecated...
    }
}

// Modules.kt
fun injectFeature() = loadFeature

private val loadFeature by lazy {
    loadKoinModules(
        viewModelModule,
        useCaseModule,
        repositoryModule,
        dataSourceModule,
        networkModule,
        cacheModule
    )
}

// in Activity
onCreate() {
	super.onCreate()
	injectFeature()
}

What I tried

// Application
class App: Application() {
    override fun onCreate() {
        super.onCreate()

        startKoin(this, listOf(networkModule, analyticsModule))
    }
}

// in Activity One
onCreate() {
	super.onCreate()
	loadKoinModules(listOf(oneViewModelModule))
}
// in Activity Two
onCreate() {
	super.onCreate()
	loadKoinModules(listOf(twoViewModelModule))
}

it works, however, it throws Exception like this when calling loadKoinModules again...
org.koin.error.BeanOverrideException: Try to override definition with Factory [name='OneViewModel...

how navigation works

I don't understand your package name constant but, how setClassName works for passing postlist to postdetail? When I use your navigation, I have an ActivityNotFoundException with have you declared this activity in your AndroidManifest.xml?

Build error

C:\Android-Kotlin-MVI-CleanArchitecture\build\build-attribution\androidGradlePluginAttributionData: The process cannot access the file because it is being used by another process.

I get this error when I try to run the app on the master branch.

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.