4 ms·
Disclaimer: I am not an Android developer. I cannot seem to reconcile these two statements: > Should you use MVC? Or MVP? Or MVVM? I have no idea. Heck, I
by vowelless 10y ago
Disclaimer: I am not an Android developer.
I cannot seem to reconcile these two statements:
> Should you use MVC? Or MVP? Or MVVM? I have no idea. Heck, I only know about MVC from school and had to do a Google search to find other options to put here.
And
> In Android, however, we explicitly decided we were not going to have a main() function, because we needed to give the platform more control over how an app runs.
So this person claims to not know or care about design patterns; but then explicitly enforcing a design pattern?
She does say:
> Android could feel like it has strong opinions on how apps should be written. With its Java language APIs and fairly high-level concepts, it can look like a typical application framework that is there to say how applications should be doing their work. But for the most part, it is not.
But after reading through the post, it does seem like a particular set of design patterns is being propagated.
- EddieRingle 10y agoSeems many people are missing the overall point of the post: The APIs Android provides that are listed here are intended to be used as the glue between your application and the rest of the system. However you want to build your application from that point on is up to you. In particular, Android Activities aren't simply a main() function because they are designed from a multitasking standpoint; users are going to be going in and out of apps, changing the state of the device (such as rotating the device), etc. In other application environments, you might register callbacks to fire when the window is hidden or gets resized. In Android those callbacks already exist and are set in stone to encourage apps to behave as a good citizen on a potentially resource-constrained mobile device. But as the post details, you don't have to do anything beyond properly managing heavy resources (like camera access) and saving and restoring state at the appropriate points if you don't want to.