-2

I've created a simple android project with Android Studio. How to create layers? I mean data, presentation, domain layers using Android studio.I'm trying to understand how to use Clean Architecture pattern in my Android apps.

As I understand to create a new layer I need to do this Click on Project folder -> Create new Module -> Select Java Library. Am I right?

msfvenom
  • 17
  • 6
  • I figure out you are trying to ask if a layer of the Clean Arch., could be a Java library or an Android module or even a single package inside the same module(app)... – jnfran92 May 30 '19 at 16:53

1 Answers1

2

Check out this sample to-do app from Google:

https://github.com/googlesamples/android-architecture/tree/todo-mvp-clean/

There will be 3 layers: presentation, domain and data.

Presentation: View related code. There are View, Presenter and its contract.

Domain: Usecase (Interactor), business objects and control objects.

Data: Repository - local (db) and remote (server).

Bob
  • 13,447
  • 7
  • 35
  • 45
  • So! As I understand to create a new layer I need to do this Click on Project folder -> Create new Module -> Select Java Library. Am I right? – msfvenom Aug 07 '17 at 12:18
  • 1
    I don't think you're telling him anything he doesn't already know – Tim Aug 07 '17 at 12:18
  • Check this article https://proandroiddev.com/multiple-ways-of-defining-clean-architecture-layers-bbb70afa5d4a and this project https://github.com/igorwojda/android-showcase – Igor May 06 '20 at 10:06