Timer- run on period of time after delayfixedRateit is used to run on strict period meaning if one execution is late others will speed up to catch up- normal it is used when smoothness is required meaning if one execution is late it will not speed up to catchup
CountDownTimer- used to count down certain time with tick periodHandler- is a mechanism that allows you to delay action for certain amount of timeTimeUnitvery useful for converting time from seconds to milliseconds and similar
- Fragments are used to outsource UI management to fragments classes from activity so you can more easily support tablet and phone design by not having to rewrite same ui elements for both instead just map fragments differently. And also help on reuse of ui elements
- Fragments have there life cycle methods similarly to activates Fragments life cycle
- Fragments are made similarly as activates you need:
- Create a layout file
- Implement Life cycle methods
- Inflate layout file
- You have two ways to add a fragment to your activity
- Add it in layout file less flexible it dose not support swapping fragments but simpler
- Add it form code more flexible but harder
onCreate()is used for setting up states of fragment(members and so on), returning saved state and similar but it is not used for inflating layout fileonCreateView()is used to inflate layout file as well as setup references to ui widgets and set up handlers and similar