Best practice for package structure in an MVP project

后端 未结 3 1532
余生分开走
余生分开走 2021-01-31 06:50

I have an Android Studio project that is using an MVP architecture. What is the advised packages structure for a project this style we can do:

app:
  screen_nam         


        
3条回答
  •  没有蜡笔的小新
    2021-01-31 07:04

    MVP is good choice. You can follow following pattern:

    app: 1. activities: + interface to represent view (i.e activity) + actual activity java class 2. Presenter: + interface to represents presenter + java class to represent presenter implementation 3. Model: + interface to represents model + java class to represent model implementation (do network calls here, pass callback to presenter which then gives data to activity)

提交回复
热议问题