Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.

Slides:



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

Android architecture overview
CSE2102 Introduction to Software Engineering Lab 2 Sept/4/2013.
Android Aims to bring Internet-style innovation and openness to mobile phones.
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 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.
Basic Functionality in Android. Functionality in Android Events in Java – mouse related mouse clicked button down or up mouse entered – many others key.
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Android 101 Application Fundamentals January 29, 2010.
@2011 Mihail L. Sichitiu1 Android Introduction Communication between Activities.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
Android Application Development Tutorial. Topics Lecture 5 Overview Overview of Networking Programming Tutorial 2: Downloading from the Internet.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Mobile Programming Lecture 16 The Facebook API. Agenda The Setup Hello, Facebook User Facebook Permissions Access Token Logging Out Graph API.
Android Tutorial Team 3 Jerry Yu Mayank Mandava Mu Du Will Wangles.
Chapter 2: Simplify! The Android User Interface
Mobile Programming Lecture 6
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Android Programming-Activity Lecture 4. Activity Inside java folder Public class MainActivity extends ActionBarActivity(Ctrl + Click will give you the.
Threads and Services. Background Processes One of the key differences between Android and iPhone is the ability to run things in the background on Android.
Android - Broadcast Receivers
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
Introduction to Android
Activities and Intents Richard S. Stansbury 2015.
Android and s Ken Nguyen Clayton state University 2012.
TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
Mobile Programming Lecture 4 Resources, Selection, Activities, Intents.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Android Programming.
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Introduction to android
Android Application -Architecture.
Android Programming - Features
Android Introduction Hello World
Mobile Development Workshop
Android N Amanquah.
Java Examples Embedded System Software
Activities, Fragments, and Events
Android Introduction Hello World.
Communication between Activities
Android Mobile Application Development
ITEC535 – Mobile Programming
HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung
MultiUni Trần Vũ Tất Bình
CIS 470 Mobile App Development
Adding Functionality to the App Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity.
CMPE419 Mobile Application Development
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Activities and Intents
CIS 470 Mobile App Development
Activity & Intent.
ארועים ומאזינים android.
Cosc 4730 An Introduction.
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
Activities, Fragments, and Intents
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Android Activities 1

What are Android Activities? Activities are like windows in an Android application An application can have any number of activities Main purpose of an activity is to interact with the user Using Intents you can go from on Activity to another – More on Intents later 2Android Activities

Programming an Activity To program an Activity you must create a Java class extending the class android.app.Activity You probably want to override the method onCreate() public class MyActivity extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } 3Android Activities

Describing activities in the AndroidManifest.xml file When you create a new Activity, the Activity is described in the AndroidManifest.xml file. Each application has a single AndriodManifest.xml file Describing all the activities And a lot of other things … Android Studio – App -> src -> main -> AndroidManifest.xml 4Android Activities

Activity life cycle 5Android Activities

Life cycle methods An Activity object goes through quite an elaborate life cycle. The Activity class defines a number of methods which are called when an object goes from one stage to another in the life cycle – Example: LifecycleDemo We can override the methods in our own Activity class – Template Method design pattern Super class is concrete (not abstract) with lots of hook methods Android Activities6