Category : clean-architecture

I try to implement clean architecture in a small app Android ( just to test this clean Architecture). But I can’t figure out how can I do with user. My example is user can be freemium or premium. For freemium, data are stored in room database and for premium in a server. Of course app ..

Read more

I would like to try and describe this issue as simply as possible. My project is currently using Koin for dependency injection. I am trying to stick to a clean architecture where possible. My project consists of UseCases, which will have a repository injected, which contains my Retrofit apiInterface and also in some cases a ..

Read more

I am developing a multi-module Android project following the Clean Architecture. I use Hilt to provide dependency injection into the application. Here is the structure of the application: There are two main modules, app which contains all android related dependencies, and core which contains data and domain packages. In core module I have this interface: ..

Read more

I’m developing an app with clean architecture principles. I’ve a domain module which is a Java/Kotlin module and it hasn’t android dependencies and a domainImpl module which is an Android module and has dependencies to local, remote and domain module. this is a Repository example inside domain module: interface MovieRepository { fun getMovie(id: Long): Flow<Movie> ..

Read more

I am trying to implement Clean Architecture on my Android App with standard MVVM components. Most of the things are clear, but I am struggling with where to put Retrofit API methods like addToFavorites, cancel, sell, etc. (i.e. not pure CRUD methods). I see two options: Repository -> this resulted in huge repositories with much ..

Read more

my project is base on clean architecture unfortunately I Can’t get my error in coroutines but an error work in logcat and it’s being shown. here is my activity class SplashScreen : AppCompatActivity() { private val mainViewModel:MainViewModel by viewModels() private lateinit var imageView: ImageView private lateinit var textView: TextView private lateinit var button: Button private ..

Read more

I’ve been trying to implement this guide about Clean Architecture https://rubygarage.org/blog/clean-android-architecture. In this guide it trying to put CompositeDisposable in UseCase and dispose it whenever needed from ViewModels. But in the end, when I use ViewModels in Fragment -> Making Network Request -> Cancel it before it’s done(navigate to another fragment), It always showup a ..

Read more

I’m new to android, I wanted to know if it is okay to access properties initialized in activity / call activity functions from fragment like this or is it bad practice and I should avoid it. (requireContext() as BaseActivity).viewModel (requireContext() as BaseActivity).countryList (requireContext() as BaseActivity).getSomething() Source: Android..

Read more