Adding Functionality to the App Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Advertisements

CE881: Mobile and Social Application Programming Simon M. Lucas Quiz, Walkthrough, Exercise, Lifecycles, Intents.
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Cosc 5/4730 Android: “Dynamic” data.. Saving Dynamic data. While there are a lot of ways to save data – Via the filesystem, database, etc. You can also.
Chapter 6: Jam! Implementing Audio in Android Apps.
Programming with Android: Activities
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.
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
How Inflation Works!. Examine the following code public class MainActivity extends Activity public void onCreate(Bundle savedInstanceState)
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Chapter 10: Move! Creating Animation
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
Chapter 2: Simplify! The Android User Interface
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
DUE Hello World on the Android Platform.
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.
Android Boot Camp for Developers Using Java, 3E
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
Introduction to Android
New Activity On Button Click via Intent. App->res->Layout->Blank Activity A new xml file is created and a new class is added to java folder. In manifest.xml.
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
The Flag Quiz app tests your ability to correctly identify 10 flags from various countries and territories.
Working with Multiple Activities. Slide 2 Introduction Working with multiple activities Putting together the AndroidManifest.xml file Creating multiple.
Editing a Twitter search. Viewing search results in a browser.
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Introduction to android
Java FX: Scene Builder.
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Android Studio, Android System Basics and Git
Android Boot Camp for Developers Using Java, 3E
Activities, Fragments, and Events
Fragment ?.
Mobile Application Development BSCS-7 Lecture # 6
Mobile Applications (Android Programming)
MAD.
Activities and Intents
Android Activities An application can have one or more activities, where Each activity Represents a screen that an app present to its user Extends the.
ITEC535 – Mobile Programming
The Android Activity Lifecycle
Embedding the Reporting Engine Version 3.5
Using GUI Objects and the Visual Studio IDE
ANDROID UI – FRAGMENTS UNIT II.
Anatomy of an Android Application
CIS 470 Mobile App Development
Cannon Game App Android How to Program
Activities and Intents
CIS 470 Mobile App Development
Android SDK & App Development
Objects First with Java
Mobile Programming Dr. Mohsin Ali Memon.
SE4S701 Mobile Application Development
Activities and Fragments
Cosc 5/4730 EmojiCompat library..
Clip & Convert to ASCII Program Kelly Knapp Spring 2010
SeeSoft A Visualization Tool..
Mobile Programmming Dr. Mohsin Ali Memon.
Activities, Fragments, and Intents
Android Sensor Programming
Presentation transcript:

Adding Functionality to the App

Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity is starting and its GUI is about to be displayed so that the user can interact with the Activity. OnSaveInstanceState is called by the system when the configuration of the device changes during the app’s execution

Overriding Method OnCreate of Class Activity

Overriding Method OnCreate of Class Activity When the system calls onCreate, it passes a Bundle to parameter savedInstanceState. this state information is saved by the Activity’s onSaveInstanceState Method. Generated class R that contains nested static classes representing each type of resource in your project’s res folder. You can find R class in your project’s gen folder, which contains generated source-code files.

Some of the nested classes in class R include

inflating the GUI setContentView receives the constant R.layout.main to indicate which XML file represents the activity’s GUI. the constant represents the main.xml file. Method setContentView uses this constant to load the corresponding XML and converted into the app’s GUI.