Skip to content
Eugen Kiss edited this page Apr 4, 2015 · 2 revisions
Why activities over fragments?

The title of this question used to be "Why fragments over activites" and the answer used to be the following.

It's easier to communicate / pass complex data between fragments than between activites. It's also more natural to use fragments for a navigation drawer based UI. See these points for a good summary of further general advantages.

While these points are not wrong they don't talk about the downsides to fragments either. I had to use many workarounds to treat fragments like activities for Chanobol's drawer-based app structure. Granted, the workarounds were manageable—until I tried to incorporate Lollipop transitions. The gymnastics I had to do to make them work with my fragment-based app structure were unbelievable and the final result was thin. So I decided to switch to an activity-based app structure and drawer layout like iosched. Yes, providing arguments to activities involes a lot of scaffolding and there are other disadvantages. But all in all the resulting code and UI became much nicer as many problems and workarounds simply vanished.

Why not a view based MVP approach?

Mainly, I simply did not find enough example MVP projects to be convinced that it is really a better approach. I'm not against it but I must see the concrete advantages for Chanobol to be convinced and it's not the case yet.

Why Dagger?

Maybe the question that should come before is "Why Dependency Injection"?:

Some concrete points for Dagger:

Why Ion over Picasso, Retrofit & OkHttp for Chanobol?

In general, see: http://www.reddit.com/r/androiddev/comments/30v3ig/moshi_a_new_json_library_from_square/cpwdgi2

TODO: Specific problems and advantages.