Mobile Applications (Android Programming)

Slides:



Advertisements
Similar presentations
Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dellInformazione Università di Bologna.
Advertisements

Programming with Android: Activities
Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Fragments: Introduction Fragments were introduced in Android 3.0 to support flexible and dynamic UI designs represent portions of an application’s user.
Android 02: Activities David Meredith
The Android Activity Lifecycle. Slide 2 Introduction Working with the Android logging system Rotation and multiple layouts Understanding the Android activity.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Android Fragments.
More on User Interface Android Applications. Layouts Linear Layout Relative Layout Table Layout Grid View Tab Layout List View.
WebDynpro for ABAP Short introduction.
Programming with Android: Android Fragments Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Android Fragments A very brief introduction Android Fragments1.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
CS378 - Mobile Computing What's Next?. Fragments Added in Android 3.0, a release aimed at tablets A fragment is a portion of the UI in an Activity multiple.
MVC pattern and implementation in java
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
ANDROID UI – FRAGMENTS. Fragment  An activity is a container for views  When you have a larger screen device than a phone –like a tablet it can look.
Chapter 2: Simplify! The Android User Interface
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
Mobile Application Development using Android Lecture 2.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
University of Sunderland COM 220 Lecture Six Slide 1 Building Interactive Forms Applications using Oracle.
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml.
Android – Fragments L. Grewe.
Activities Димитър Н. Димитров Astea Solutions AD.
Understand Windows Services Software Development Fundamentals LESSON 5.3.
Class on Fragments & threads. Fragments fragment is a modular section of an activity, which has its own lifecycle, receives its own input events, and.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
School of Engineering and Information and Communication Technology KIT305/KIT607 Mobile Application Development Android OS –Permissions (cont.), Fragments,
Android Fragments. Slide 2 Lecture Overview Getting resources and configuration information Conceptualizing the Back Stack Introduction to fragments.
The Flag Quiz app tests your ability to correctly identify 10 flags from various countries and territories.
1. 2 The Address Book app provides convenient access to contact information that’s stored in a SQLite database on the device. You can: scroll through.
Chapter 2: Simplify! The Android User Interface
Mobile Applications (Android Programming)
Guided By: Dr. Mingon Kang
Mobile Applications (Android Programming)
Mobile Applications (Android Programming)
Mobile Applications (Android Programming)
Mobile Applications (Android Programming)
Working in the Forms Developer Environment
Activity and Fragment.
Mobile Applications (Android Programming)
Activities, Fragments, and Events
Fragment ?.
Fragments: Introduction
Mobile Applications (Android Programming)
Mobile Application Development BSCS-7 Lecture # 6
MAD.
Activities and Intents
Anatomy of an Android App and the App Lifecycle
Widgets & Fragments Kalin Kadiev Astea Solutions AD.
Android Mobile Application Development
Mobile Applications (Android Programming)
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
The Android Activity Lifecycle
Android – Fragments L. Grewe.
ANDROID UI – FRAGMENTS UNIT II.
Anatomy of an Android App and the App Lifecycle
Mobile Applications (Android Programming)
Activities and Intents
HNDIT2417 Mobile Application Development
Mobile Applications (Android Programming)
Programming Mobile Applications with Android
Mobile Applications (Android Programming)
Activities and Intents
Mobile Programming Dr. Mohsin Ali Memon.
Activities and Fragments
Android Development Tools
Activities, Fragments, and Intents
Presentation transcript:

Mobile Applications (Android Programming) Semester II 2016 - 2017 Dr. Saman Mirza Abdullah

Class Objective The objective of this class is: To learn and understand Fragments. To learn the functions that needed to build fragments. Mobile Application - Ishik

Fragments Fragment is an Android programming aspect that represents a portion of the user interface of what a user sees on the application window. The Android documentation describes Fragment as a portion of user interface in an Activity Object. This means an Activity object can be composed of one or more fragments, each having its own user interface definition. Developers can combine one or more fragments to build a single activity or even reuse fragments across multiple activities Mobile Application - Ishik

With (out) Fragments Without fragments, classically, developers would have to build a new Activity whenever the user interacted with the application. With Fragments, developers now can update another portion of the UI on the screen that corresponds to the user selection,, without needing to move the user to another screen” Mobile Application - Ishik

Fragments Fragments provide for developers ability to create a dynamic and multi-pane user interface on Android. You need to encapsulate UI components and activity behaviors into modules that you can swap into and out of your activities Fragment behaves somewhat like a nested activity that can define its own layout and manage its own lifecycle. Mobile Application - Ishik

Fragment’s Lifecycle A fragment must always be embedded in an activity and the fragment's lifecycle is directly affected by the host activity's lifecycle. For example, when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all fragments However, while an activity is running you can manipulate each fragment independently, such as add or remove them.  Mobile Application - Ishik

Fragment and Back button When fragment performs a transaction, a back stack can be added. It can managed by the activity Each back stack entry in the activity is a record of the fragment transaction that occurred. The back stack allows the user to reverse a fragment transaction (navigate backwards), by pressing the Back button. Mobile Application - Ishik

Fragment and Back button When fragment performs a transaction, a back stack can be added. It can managed by the activity Each back stack entry in the activity is a record of the fragment transaction that occurred. The back stack allows the user to reverse a fragment transaction (navigate backwards), by pressing the Back button. Mobile Application - Ishik

Fragment Philosophy Mobile Application - Ishik

Fragment’s Lifecycle Mobile Application - Ishik

Creating Fragments Fragments can be crated using subclasses. It has the following callback methods: onCreate() onCreatView() onPause() Mobile Application - Ishik

Fragment – onCreat() The system calls this method when creating the fragment. It needs to initialize essential components of the fragment, when wants to retain on the following states: On paused On stopped, or On resumed. Mobile Application - Ishik

Fragment – onCratView() The system calls this method when the fragment needs to draw its users interface for the first time. It needs the View return methods to view the fragment. Mobile Application - Ishik

Fragment – onPause() The system calls this method as the first indication that the user is leaving the fragment. The onCommit () method will be involved. Mobile Application - Ishik

Crating a Fragment Crating a subclass from Fragments main class. This needed to tell that there is a Fragment in this activity. Mobile Application - Ishik

Crating a Fragment The parameters of crating the Fragments are automatically working in your code. Mobile Application - Ishik

Crating a Fragment The return inflate method. Mobile Application - Ishik

Mobile Application - Ishik

Adding Fragments Fragments need to be added inside the Activity. Mobile Application - Ishik

Class End Mobile Application - Ishik