Search code examples
androidmvvmandroid-contentproviderclean-architecture

ContentProvider Placing in android clean architecture


I have packaged my app module into data, domain and presentation layer and following the MVVM design pattern. I want to expose my database via content provider to another app. Where should I place the content provider in this architecture?


Solution

  • It'll be in the data layer. We can create a data source class for communicating with content provider. You can find a sample implementation in this link, which shows fetching contacts from content provider.

    enter image description here