Activities Димитър Н. Димитров Astea Solutions AD.

Slides:



Advertisements
Similar presentations
Programming with Android: Activities
Advertisements

Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
CSE2102 Introduction to Software Engineering Lab 2 Sept/4/2013.
Chapter 6 Jam! Implementing Audio in Android Apps.
Chapter 6: Jam! Implementing Audio in Android Apps.
Android Application Model (3)
Programming with Android: Activities
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 101 Application Fundamentals January 29, 2010.
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.
Programming with Android: Android Fragments Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
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.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
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.
Android Mobile computing for the rest of us.* *Prepare to be sued by Apple.
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
Mobile Application Development using Android Lecture 2.
Activities and Intents. Activities Activity is a window that contains the user interface of your application,typically an application has one or more.
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml.
Android – Fragments L. Grewe.
Working in the Background Radan Ganchev Astea Solutions.
Noname. Conceptual Parts States of Activities Active Pause Stop Inactive.
Activity Android Club Agenda Hello Android application Application components Activity StartActivity.
Mobile Programming Midterm Review
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
Class on Fragments & threads. Fragments fragment is a modular section of an activity, which has its own lifecycle, receives its own input events, and.
Activities and Intents Chapter 3 1. Objectives Explore an activity’s lifecycle Learn about saving and restoring an activity Understand intents and how.
Introduction to Android OS Димитър Н. Димитров Astea Solutions AD.
Android intro Building UI #1: interactions. AndroidManifest.xml permissions 2.
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.
Building UI Components Димитър Н. Димитров Astea Solutions AD.
Open Handset Alliance.
Mobile Application Development BSCS-7 Lecture # 2
Activity and Fragment.
Mobile Programming Lecture 2
Basic Activities and Intents
Activities, Fragments, and Events
Mobile Application Development BSCS-7 Lecture # 6
Mobile Applications (Android Programming)
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 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.
Android Programming Lecture 9
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
Android Topics UI Thread and Limited processing resources
Activities and Intents
CIS 470 Mobile App Development
Activities and Intents
SE4S701 Mobile Application Development
Activities and Fragments
Android Development Tools
Activities, Fragments, and Intents
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Activities Димитър Н. Димитров Astea Solutions AD

Recap: Android components Activity Service BroadcastReceiver ContentProvider Intent (?)

Starting an Android component – components can be started with Intents – Android creates the components and manages their lifecycle Application flow – in Java: everything starts from the main() method – in Android: no obligations for single entry point – pretty much everything you see in the application flow is managed by an Activity Applications and components

Activity “...a single, focused thing that the user can do.” creates a window and initializes the UI for it reacts on user interactions allows you to interact with the system functions and services – see android.content.Context

Activity lifecycle Activity states – resumed (running) – paused – stopped Lifecycle loops – entire lifetime – visible lifetime – foreground lifetime

Activity lifecycle Entire lifetime

Activity lifecycle Visible lifetime

Activity lifecycle Foreground lifetime

Activity lifecycle Activity is “killable” after: onPause() onStop() onDestroy() Two-Activity scenario: – A.onPause() – B.onCreate() – B.onStart() – B.onResume() – A.onStop() (already not visible)

android.app.Activity Starting an activity void startActivity(Intent intent)Intent void startActivityForResult(Intent intent, int requestCode)Intent – AndroidManifest.xml Important methods void setContentView() void onSaveInstanceState(Bundle)/void onRestoreInstanceState(Bundle)

Tasks Android groups Activities, started in order to perform a certain job in tasks – tasks are stacks (first in, first out) – clicking the hardware BACK button pops the current Activity from the stack, by default How many instances of a given Activity can I have? How can I start an Activity in a new task? What Activity will be resumed, when I press BACK?

Activities & your application All the different “screens” in your application should be different Activities – try not to put too much stuff in a single Activity Activities should encompass most of the business logic of your application – Activities act as a controller in the MVC pattern Start with a simple diagram and evolve it

Breaking news! Android 4.0 has just been released! It should bridge the gap between Android APIs for tablets and smartphones

Q&A + Feedback Questions? Feedback section: – Did you hear well? – Was there anything you didn’t understand? – What would you like changed in our next lecture?

Recommended resources als/activities.html als/activities.htm als/tasks-and-back-stack.html als/tasks-and-back-stack.html elines/activity_task_design.html elines/activity_task_design.html %E2%80%93controller %E2%80%93controller