NHAP MON UNG DUNG DI DONG – Flag Quiz App 3Introduction... NHAP MON UNG DUNG DI DONG – Flag Quiz App 5Introduction... NHAP MON UNG DUNG DI DONG – Flag Quiz App 7Introduction... NHAP MON
Trang 1NHẬP MÔN ỨNG DỤNG DI ĐỘNG
C hươn g 4 : Flag Quiz Ap p
Nhóm : 2918
Trang 3NHAP MON UNG DUNG DI DONG – Flag Quiz App 3
Introduction
Trang 4Introduction
Trang 5NHAP MON UNG DUNG DI DONG – Flag Quiz App 5
Introduction
Trang 6Introduction
Trang 7NHAP MON UNG DUNG DI DONG – Flag Quiz App 7
Introduction
Trang 8Introduction
Trang 9NHAP MON UNG DUNG DI DONG – Flag Quiz App 9
Introduction
Trang 10Fragments
Preferences
Assets Folder and Resource Folders
Screen Sizes, Resolutions and Device Orientation
Toasts
Handler
Technologies Overview
Trang 11NHAP MON UNG DUNG DI DONG – Flag Quiz App 11
Animation
ViewAnimationUtils
Color state list
AlertDialog
Logging Exception Messages
Launching Another Activiy Via an Explicit Intent
AndroidManifest.xml
Technologies Overview
Trang 12Menus
Trang 13NHAP MON UNG DUNG DI DONG – Flag Quiz App 13
Fragments
A Fragment represents a behavior or a portion of user interface in an Activity You can combine multiple fragments in a single activity to build
a multi-pane UI and reuse a fragment in multiple activities You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a "sub activity" that you can reuse in different activities).
Trang 14Fragments – Lifecycles
onCreate—This method is called when a Fragment is created The MainActivityFragment and SettingsActivityFragment are created when the app
inflates their parent activities’ layouts The DialogFragment that displays the quiz results is created and displayed dynamically when the user completes a quiz
onCreateView—This method (which you’ll override in class MainActivityFragment) is called after onCreate to build and return a View containing the
Fragment’s GUI As you’ll see, this method receives a LayoutInflater, which you’ll use to programmatically inflate a Fragment’s GUI from the
components specified in a predefined XML layout.
Trang 15NHAP MON UNG DUNG DI DONG – Flag Quiz App 15
Managing Fragments
Trang 16preferrences
Trang 17NHAP MON UNG DUNG DI DONG – Flag Quiz App 17
Assets Folder
Trang 18RESoURCE Folder
Trang 19NHAP MON UNG DUNG DI DONG – Flag Quiz App 19
Screen Sizes, Resolutions
Trang 20Device Orientation
Trang 21NHAP MON UNG DUNG DI DONG – Flag Quiz App 21
Toasts
Trang 22handler
Trang 23NHAP MON UNG DUNG DI DONG – Flag Quiz App 23
animation
Trang 24ViewAnimationUtils
Trang 25NHAP MON UNG DUNG DI DONG – Flag Quiz App 25
Color state list
Trang 26Alert dialog
Trang 27NHAP MON UNG DUNG DI DONG – Flag Quiz App 27
Logging Exception Messages
Trang 28Launching Another Activiy Via an Explicit Intent
Trang 29NHAP MON UNG DUNG DI DONG – Flag Quiz App 30
Demo app
Trang 30The end