Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

 An archive file marked by an.apk suffix.  Java code + any data +resource files  is bundled by the aapt tool into an aapt tool ◦ Android Asset Packaging.
Android Overview. Android (Google) is a widely anticipated open source operating system for mobile devices, Supporting Bluetooth ( wireless for short.
Android Application Model (3)
Android 02: Activities David Meredith
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
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.
Mobile Programming Pertemuan 6 Presented by Mulyono Poltek NSC Surabaya.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
@2011 Mihail L. Sichitiu1 Android Introduction Application Fundamentals.
Android Application Development CSE 5520/4520 Wireless Networks.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Middleware Bo Pang
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
 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.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Presentation Seminar on “IMAGE SLIDER –AN ANDROID APPLICATION”
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
Mobile Application Development using Android Lecture 2.
CS378 - Mobile Computing Intents.
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.
Overview of Android Application Development
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
Android Security Model that Provide a Base Operating System Presented: Hayder Abdulhameed.
Mobile Application Security on Android Originally presented by Jesse Burns at Black Hat
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
DKU-MUST Mobile ICT Education Center 10. Activity and Intent.
Lecture 2: Android Concepts
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.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Introduction to Android Programming
Android Application -Architecture.
Mobile Applications (Android Programming)
Lecture 2: Android Concepts
Android 01: Fundamentals
Mobile Application Development BSCS-7 Lecture # 2
Android Application Development 1 6 May 2018
Mobile Programming Lecture 2
Lecture 2 Zablon Ochomo Android Programming Lecture 2 Zablon Ochomo
Reactive Android Development
Android Runtime – Dalvik VM
MAD.
Activities and Intents
Android Mobile Application Development
Mobile Device Development
Anatomy of an Android Application
Android Programming Lecture 9
Android Programming Lecture 5
Application Fundamentals
Application Development A Tutorial Driven Course
Activities and Intents
HNDIT2417 Mobile Application Development
Activities and Intents
Emerging Platform#3 Android & Programming an App
Introduction to Android
Application Fundamentals
Lecture 2: Android Concepts
Chapter 5 Your Second Activity.
Presentation transcript:

Application Fundamentals Android Development

Announcements Posting in D2L Tutorials

From Previous lecture Android applications are written in the Java programming language. Components: Activity Service ContentProvider BroadcastReceiver Intents: Action, Data = Implicit Action, Data, Component = Explicit

The AndroidManifest.xml File Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest presents essential information about the application to the Android system, information the system must have before it can run any of the application's code.

The Manifest file It names the Java package for the application. The package name serves as a unique identifier for the application. It describes the components of the application ( activities, services, broadcast receivers, and content providers) It determines which processes will host application components.

The Manifest file It declares which permissions the application must have in order to access protected parts of the API and interact with other applications. It declares the minimum level of the Android API that the application requires. It lists the libraries that the application must be linked against.

Sample Manifest file <manifest xmlns:android=" package="test.test" android:versionCode="1" android:versionName="1.0"> <activity android:name=".main"

Applications Components Activities Services Content Providers Broadcast receivers

Activities An activity presents a visual user interface for one focused endeavor the user can undertake. An application might consist of just one activity or, like a text messaging application, it may contain several. Each activity is given a default window to draw in. The visual content of the window is provided by a hierarchy of views.

Activities Launch an Activity by calling startActivity(Intent) Subactivities: startActivityForResult Takes an Intent as input, as well as an integer code. When subactivity exits, returns a result code. Original activity’s onActivityResultmethod is called. Note –this is asynchronous (non-blocking). Activities form a stack New activities appear at the top of the stack (i.e. on screen) Pressing back button goes to previous activity (usually)

Services A service doesn't have a visual user interface, but rather runs in the background for an indefinite period of time. For example, a service might play background music as the user attends to other matters.

Broadcast receivers A broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Events or other applications could initiate broadcasts. An application can have any number of broadcast receivers to respond to any announcements it considers important.

Content providers A content provider makes a specific set of the application's data available to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner that makes sense. Applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead.ContentResolver

Activating components ContentResolver – Content providers are activated when they're targeted by a request from a ContentResolver. Intents – Activities, services, and broadcast receivers are activated by asynchronous messages called intents.

Intents An intent is an Intent object that holds the content of the message.Intent For activities and services, it names the action being requested and specifies the URI of the data to act on. For example, it might convey a request for an activity to present an image to the user or let the user edit some text.

Intents For broadcast receivers, the Intent object names the action being announced. For example, it might announce to interested parties that the camera button has been pressed.

Shutting down components A content provider is active only while it's responding to a request from a ContentResolver. A broadcast receiver is active only while it's responding to a broadcast message. So there's no need to explicitly shut down these components.

Shutting down components An activity can be shut down by calling its finish() method. One activity can shut down another activity by calling finishActivity(). finish()finishActivity() A service can be stopped by calling its stopSelf() method, or by calling Context.stopService(). stopSelf() Context.stopService()

Shutting down components Components might also be shut down by the system when they are no longer being used or when Android must reclaim memory for more active components

Intent filters An Intent object can explicitly name a target component. If it does, Android finds that component (based on the declarations in the manifest file) and activates it. But if a target is not explicitly named, Android must locate the best component to respond to the intent. It does so by comparing the Intent object to the intent filters of potential targets.

Intent filters A component's intent filters inform Android of the kinds of intents the component is able to handle. Like other essential information about the component, they're declared in the manifest file.

Example...

First Filter The first filter in the example — the combination of the action "android.intent.action.MAIN" and the category "android.intent.category.LAUNCHER" — is a common one. It marks the activity as one that should be represented in the application launcher, the screen listing applications users can launch on the device. In other words, the activity is the entry point for the application, the initial one users would see when they choose the application in the launcher.

Second Filter The second filter declares an action that the activity can perform on a particular type of data.