An android developer would know that fragments in the Android API are a powerful set of tools. But with that great power it puts great responsibility on the developer.
Fragment debugging is an informative presentation on how to effectively use android fragments.
2. Fragment – What and Why?
Definition: A Fragment represents a behavior or a portion of
user interface in an activity.
Flexible UI
Re-usable
Embedded in the parent activity
Application specific subclasses –
◦ DialogFragment, ListFragment, PreferenceFragment
Key Classes:
- Fragment
- FragmentManager
- FragmentTransaction
Ref:
http://developer.android.com/guide/components/fragments.html
4. Concerns for Developers
Creation of fragments
◦ Adding UI
◦ Adding to parent activity
Management of fragments
Performing fragment transactions
Communicating with activities and
other fragments
Handling the fragment life-cycle
13. Safer to play by the book
Fragment best practices guidelines –
◦ Creating a fragment –
https://developer.android.com/training/basics/fr
agments/creating.html
◦ Building a flexible UI -
https://developer.android.com/training/basics/fr
agments/fragment-ui.html
◦ Communicating with other fragments –
https://developer.android.com/training/basics/fr
agments/communicating.html