Android Mobile computing for the rest of us.* *Prepare to be sued by Apple.

Slides:



Advertisements
Similar presentations
Programming with Android: Activities
Advertisements

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.
CSE2102 Introduction to Software Engineering Lab 2 Sept/4/2013.
Fragments: Introduction Fragments were introduced in Android 3.0 to support flexible and dynamic UI designs represent portions of an application’s user.
Android Application Model (3)
Programming with Android: Activities
CSS216 MOBILE PROGRAMMING Android, Chapter 3 Book: “Professional Android™ 2 Application Development” by Reto Meier, 2010 by: Andrey Bogdanchikov (
Android 02: Activities David Meredith
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
The Android Activity Lifecycle. Slide 2 Introduction Working with the Android logging system Rotation and multiple layouts Understanding the Android activity.
Android activities 1 CS300. What makes an app?  Activities: presentation layer  Services: invisible workers  Content Providers: databases  Intents:
The Activity Class 1.  One application component type  Provides a visual interface for a single screen  Typically supports one thing a user can do,
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Android Fragments.
Android Life Cycle CS328 Dick Steflik. Life Cycle The steps that an application goes through from starting to finishing Slightly different than normal.
More on User Interface Android Applications. Layouts Linear Layout Relative Layout Table Layout Grid View Tab Layout List View.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
CS378 - Mobile Computing Anatomy of an Android App and the App Lifecycle.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
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.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
Android Info mostly based on Pro Android 3.  User Applications  Java Libraries – most of Java standard edition ◦ Activities/Services ◦ UI/Graphics/View.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
Activities and Intents. Activities Activity is a window that contains the user interface of your application,typically an application has one or more.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
Android Programming-Activity Lecture 4. Activity Inside java folder Public class MainActivity extends ActionBarActivity(Ctrl + Click will give you the.
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml.
Android – Fragments L. Grewe.
Mobile Programming Lecture 5 Composite Views, Activities, Intents and Filters.
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
Noname. Conceptual Parts States of Activities Active Pause Stop Inactive.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Mobile Development. Name: Saurabh Software Developer.
Activities Димитър Н. Димитров Astea Solutions AD.
Android Application Lifecycle and Menus
Lecture 6: Process and Threads Topics: Process, Threads, Worker Thread, Async Task Date: Mar 1, 2016.
Activities and Intents Chapter 3 1. Objectives Explore an activity’s lifecycle Learn about saving and restoring an activity Understand intents and how.
Services. What is a Service? A Service is not a separate process. A Service is not a thread. A Service itself is actually very simple, providing two main.
Android Fragments. Slide 2 Lecture Overview Getting resources and configuration information Conceptualizing the Back Stack Introduction to fragments.
Android Application -Architecture.
Concurrency in Android
Activity and Fragment.
Basic Activities and Intents
Activities, Fragments, and Events
Fragments: Introduction
Mobile Application Development BSCS-7 Lecture # 6
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.
Anatomy of an Android App and the App Lifecycle
Widgets & Fragments Kalin Kadiev Astea Solutions AD.
Android Mobile Application Development
The Android Activity Lifecycle
ANDROID UI – FRAGMENTS UNIT II.
Android training in Chandigarh. What is ADB ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator.
CIS 470 Mobile App Development
Anatomy of an Android App and the App Lifecycle
Activity Lifecycle Fall 2012 CS2302: Programming Principles.
Android Topics Android Activity Lifecycle and Experiment Toast
Activities and Intents
HNDIT2417 Mobile Application Development
CIS 470 Mobile App Development
Activity Lifecycle.
Activities and Intents
SE4S701 Mobile Application Development
Activities and Fragments
Android Development Tools
Korea Software HRD Center
Activities, Fragments, and Intents
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Android Mobile computing for the rest of us.* *Prepare to be sued by Apple.

Android Process Life Cycle  Process  Comprised of one or more  Activities  Services  Broadcast Receivers  Android O.S. calls all shots  Processes may be terminated if resources become scarce

Process States  Process States – Highest to Lowest Priority  Foreground Process  Process interacting with the user  Visible Process  Process the user can see or service bound to such a process  Service Process  Executing service process  Background Process  Not visible or service process – likely to be killed in order of least recently seen.  Empty Process  Processes ready to serve as hosts to newly launched applications

The Activity Stack  When an activity is started it is pushed on to the activity stack  When an activity ends it is popped off the activity stack  Activities at the bottom might be terminated if resources are needed

The Activity States  Active/Running  At the top of the activity stack  Has focus  Paused  Partially visible  Held in Memory  Ready to restart quickly  Stopped  Not at all visible  Held in Memory  Might be killed  Killed  terminated

Configuration Changes  Configuration Changes  Rotation  Changing fonts  Activity is restarted on configuration changes!!!

Dynamic vs Persistent State  Persistent State  File Data  Database Data  Dynamic State  User-Interface State

Android Activity Lifecycle Methods  onCreate(Bundle savedInstanceState)  Bundle contains dynamic state (UI state)  onRestart()  onStart()  Always called after onCreate() or onRestart(). Activity is about to become visible.  Next call will be onResume() or onStop()  onResume()  Activity is on the top of the activity stack  onPause() Another Activity is about to become foreground Store persistent state Stop animations or other cpu-intensive tasks  onStop()  The activity is no longer visible. It will either be followed by onRestart() or onDestroy()  OnDestroy()  The application has called finish() or is being destroyed to reclaim resources  No guarantee that this method will be called

More Activity Lifecycle Methods  onRestoreInstanceState(Bundle savedInstanceState)  Called immediately after onStart() if the activitiy is restarting  OnSaveInstanceState(Bundle outstate)  Called before an activity is destroyed  Provides a chance to save dynamic state

Don’t forget to tell the base “super” class  protected void onRestart()  {  super.onRestart();  // stuff you want to do here.  }

Entire Lifetime and Foreground Lifetime

Model-View-Controller (MVC)  Model – contains the program state that will be displayed  View – provides a rendering of the state  Controller – handles user interaction, usually via events *Diagram from Head First Design Patterns, by Freeman, Robson, Sierra, and Bates