I'm new to android and i have developing an android app that is starting now. It is kinds of saveable user input information with specific Date/Time. And reviewable previous stored data to user. And also store some setting information.
This may be look simple but it will cost a lot of UI components. I recently learned Activity and Fragment and preferred to use one Main Activity class and the rests are will build with Fragments.
My understanding is, Fragment is corporate with Activity Life cycle and intend to use as reusable for other Activities.
But the thing that i want to know is as i mentioned in question,
I want some advice of my question.
Activities are an ideal place to put global elements around your app's user interface, such as a navigation drawer. Conversely, fragments are better suited to define and manage the UI of a single screen or portion of a screen.
Each tab will have a fragment to hold the products. The tabs could either held in activity or a fragment. I do find fragments a slightly faster than activities but really its not something you would really notice in most cases. Regardless if they was intended for speed or not they still seem/feel little quicker.
Fragments allow such designs without the need for you to manage complex changes to the view hierarchy. By dividing the layout of an activity into fragments, you become able to modify the activity's appearance at runtime and preserve those changes in a back stack that's managed by the activity.
Check this :
Activities vs Fragments,
Activities vs Fragments and
Activities vs Fragments
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With