Simple question:
When should I use a new activity, when a new tab, when new app? I am asking from a “resources” point of view here.
I know that, obviously, the answer should depend on the app. But how and why?
Example: I am writing a gallery app to show my pictures. In one “page”, I enter the search regexp (to be matched against the filename). The result is a list of filenames, each of which has a thumbnail too. Then, after retrieving the result, a second “page” should open, showing a grid view with the thumbnails. When a thumbnail is clicked, I want a third “page” to open, with the actual big picture, fullscreen.
So, I have 3 “pages”. Which is the “best” way of implementing this: as 3 tabs? As 3 separate activities that open when needed? Or maybe the last two “pages” as tabs in a separate app?
Here, by “best” I mean from a resources/CPU/memory/lag point of view. I understand that each method gives different user experiences (swiping, for example, makes more sense with tabs), but I am not referring to this. I’m referring to speed.
I hope my question makes sense, and that I made myself clear….
Thanks!!!
L.
No difference between using tabs or not. In Android, even when you are using tabs, only one activity is active and visible at any moment on the screen and the other activities associated with the other tabs are hidden away and can be destroyed at any moment if the resources become to low. You should see the use of the tabs only as a menu that remains visible at any moment but with the disadvantage that they grab up some valuable screen space.
For the use of different applications or not; there is not much of a difference when it comes to the activities themselves: it’s not because that the activities are associated with different applications that they will be destroyed earlier or faster when the user will switch from one activity to another. However, beside the activities, the application itself requires some resources; so it’s clear that starting three activities associated with three different applications will require more resources than three activities associated with the same application.
I never saw a comparaison of the resources required for an application and the starting of any of its activity; so I cannot tell you if adding unecessary supplemental applications to your activities will grap up much more resources or not in comparaison to the resources required for the activities themselves.