CSE2102 Introduction to Software Engineering Lab 2 Sept/4/2013.

Slides:



Advertisements
Similar presentations
Programming with Android: Activities
Advertisements

Introduction to Android
Chapter 6 Jam! Implementing Audio in Android Apps.
Fragments: Introduction Fragments were introduced in Android 3.0 to support flexible and dynamic UI designs represent portions of an application’s user.
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 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.
APPFORUM2014 Helping the developer community build next-generation, multi-platform apps. SCHAUMBURG, ILLINOIS | SEPTEMBER 8-10.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
CS378 - Mobile Computing Anatomy of an Android App and the App Lifecycle.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Content Providers & Services.
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 Mobile computing for the rest of us.* *Prepare to be sued by Apple.
Android Info mostly based on Pro Android 3.  User Applications  Java Libraries – most of Java standard edition ◦ Activities/Services ◦ UI/Graphics/View.
Android development basics Introduction,Structure,Development Boncho Valkov.Net Developer.
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
COMP 365 Android Development.  Perform operations in the background  Services do not have a user interface (UI)  Can run without appearing on screen.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Recitation.
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
10/10/2015 E.R.Edwards 10/10/2015 Staffordshire University School of Computing Introduction to Android Overview of Android System Android Components Component.
Android Programming-Activity Lecture 4. Activity Inside java folder Public class MainActivity extends ActionBarActivity(Ctrl + Click will give you the.
Asst Prof. Saeed Ahmadi Software Engineering CSF Kabul University 1.
Overview of Android Application Development
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml.
Android – Fragments L. Grewe.
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
Services A Service is an application component that can perform long-running operations in the background and does not provide a user interface. An application.
Noname. Conceptual Parts States of Activities Active Pause Stop Inactive.
Activity Android Club Agenda Hello Android application Application components Activity StartActivity.
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.
Services Background operating component without a visual interface Running in the background indefinitely Differently from Activity, Service in Android.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Android Programming Steve Ko Computer Sciences and Engineering University at Buffalo.
Technische Universität München Services, IPC and RPC Gökhan Yilmaz, Benedikt Brück.
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 Application -Architecture.
Activity and Fragment.
Basic Activities and Intents
Activities, Fragments, and Events
Activities and Intents
Anatomy of an Android App and the App Lifecycle
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.
Developing Android Services
CIS 470 Mobile App Development
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
Activities and Intents
Activities and Fragments
Korea Software HRD Center
Activities, Fragments, and Intents
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

CSE2102 Introduction to Software Engineering Lab 2 Sept/4/2013

Today 1.App Fundamentals and Skeleton (last week) 1.Architecture Diagram (today) 2.Activity (today) 1.Function 2.Lifecycle 3.Coding Assignment 3.Services (today) 1.Function 2.Lifecycle 3.Coding Assignment 4.Content Providers (week 37/3) 5.Intent and Intent Filters (week 38/4) 6.Processes and Threads (week 39/5) 7.Permission (week 40/6) 8.App Widgets (week 40/6) 9.Android Manifests (week 40/6)

Architecture Diagram

What are the functions of an activity? 1.Interact in most case with user 2.Usually applications have several activities 3.Each is implemented as a subclass of base Activity class 4.Creates the window to place UI 1.setContentView(R.layout.home_activity); 5.Methods 1.protected void onCreate(Bundle savedInstanceState); // initialize 2.protected void onStart(); //activity visible 3.protected void onRestart(); //before activity becomes visible 4.protected void onResume(); // activity visible after being paused 5.protected void onPause(); // another activity becomes visible 6.protected void onStop(); // activity not visible 7.protected void onDestroy(); // cleanup and destroy activity

What is the lifecycle of an activity?

Coding Assignment (5 min) 1.Start Android Developer Tools 2.Create a new Project with one Activity 3.Define all six methods in that activity

What are the functions of a service? 1.Runs in the background – what does it mean? 2.Each is implemented as a subclass of base Service class 3.Examples – Music, TCP, REST, and other long running operations… 4.Methods 1.public void onCreate() // initialize 2.public void onStartCommand() // started 3.public void onBind() // activity to service communication 4.public void onDestroy() // cleanup resources 5.public void stopService() // stop service

Service - Function Services must be declared in AndroidManifest.xml <service android:name=“path.to.MyAppService" Remember to update the string resource file!

What is the service lifecycle? 1.Does a Service have Lifecycle? 1.Arguably no, since there is no interaction with the user, internally yes. 2.Who can start a service? 1.Services, Receivers, and Activities 3.How do you start a service? – Intent i= new Intent(getApplicationContext, MyAppService.class); – i.putExtra(“key", “value"); – getApplicationContext.startService(i);

Coding Assignment (5 min) Create a Service class Add 5 methods Start that Service through the Activity and pass a key/value pair Print out value/pair using activity on console

Questions What are the four layers of the Android Architecture Stack? What is the function of an activity? What are the four states of an activity? What are the six methods that change the state of an activity? What is a Service? What are the 5 methods that implement a service? What is the difference between Activity and Service? Who can start service?

References nts/activities.html nts/activities.html nts/services.html nts/services.html Professional Android 4 Application Development (Reto Meier, 2012)