BAB 2 Android Activities - WordPress

Transcription

BAB 2Android ActivitiesMahardeka Tri Anantadeka.kelas@gmail.comLab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB1

Outline Activity Lifecycle Overview Implementation of Activity Lifecycle MethodsLab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB2

Android Application Lifecycle In an ideal case all Android applications started by the user remain inmemory, that makes restarting applications faster. But in reality the available memory on an Android device is limited. To manage these limited resources the Android system is allowed toterminate running processes or recycling Android components.Courtesy: article.htmlLab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB3

Android Application LifecycleCourtesy:1. article.html2. Android Studio Development Essentials - Android 6 Edition page 108Lab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB4

Android Application FundamentalsAn android application consists of one or more components that aredefined in the android manifest.xml file. Here are the four types ofapp components:1. An Activity2. A Service3. A Broadcast Receiver4. A Content ProviderCourtesy : damentals.htmlLab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB5

What is Android Activity? A “single screen” with a user interface that’s visible to user An activity is a single, standalone module (subclass ofContextThemeWrapper Class) of application functionality thatusually correlates directly to a single user interface screen and itscorresponding functionality.Lab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB6

Lab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB7

The Activity Stack Managing activities in the systemCourtesy: Delwar Hossain, Dept of CSE Daffodil International Univ.Lab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB8

The Activity StateStatesDescriptionActive / RunningThe activity is at the top of the Activity Stack. Foreground task visible on thedevice screenPausedActivity is still visible but partially obscured, instance is running but might bekilled by the system.StoppedThe activity is currently not visible to the user (in other words it is totallyobscured on the device display by other activities).KilledThe Activity has been terminated by the runtime system in order to free upmemory and is no longer present on the Activity StackCourtesy: Android Studio Development Essentials - Android 6 Edition page 110Lab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB9

The Activity Lifecyclecourtesy: p/Activity.htmlLab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB10

Ayo Ngoding Jes .Lab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB11

Terima KasihSemoga BermanfaatLab. Pemrograman Aplikasi Perangkat Bergerak FILKOM UB12

Sep 03, 2016 · Android Studio Development Essentials - Android 6 Edition page 108. Android Application Fundamentals An android application consists of one or more components that are defined in the android manifest.xmlfile. Here are the four types of app compon