Which is better, putting google analytics code in the presenter or keeping them in the activity?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I think it should be put in presenter because View shouldn't know nothing about sending GAnalytics. View should be passive as much as it can be, meaning it should only have setter methods to update it's state upon presenter calls.
On the other hand, I had to wire one big project with GAnalytics with every possible action you could imagine and my experience is that it's easier to send GAnalytics from View because you can easily jump to button/textView definition and see it's role in UI which is not possible from presenter because it don't(shouldn't) have reference to any buttons/labels in UI(Activity). But that project was old monolithic view-controler(fat actvity) architecture. This days am working on MVP(clean architecture) and would like to hear other opinions on this topic. Regards