Services Broadcast Receivers Permissions

Size: px
Start display at page:

Download "Services Broadcast Receivers Permissions"

Transcription

1

2 Services Broadcast Receivers Permissions

3 Runs in the background Extends Service Java class Not necessarily connected to the user s visual interface

4 Music player working in foreground User wants read Music player should continue playing in background

5 1. Implement onserviceconnected, onservicedisconnected 2. bind to the service 3. Hope bind returns with permission granted so you can start using the service

6 Your application needs to implement onserviceconnected and onservicedisconnected because you need to know what to do as soon as a connection has been established and disconnected You also need to bind to the service

7 call Context.bindService(Intent, ServiceConnection, flags) If the Service is not running, bindservice() can start it

8 Just because you request a service doesn t mean you ll get it. onbind can DENY you permission Or onbind can GRANT permission. In which case you have gained access to the service and created a communication channel More on Android s permission architecture later

9 Write your own Service

10 Extend from Service class. You need to implement the onstart method which gets called when the service is started If you want others to connect to your service, you ll need to implement onbind

11 You can register it within AndroidManifest.XML Let Android know your application has a Service component <service android:enabled=["true" "false"] android:exported[="true" "false"] android:icon="drawable resource" android:label="string resource" android:name="com.example.project.roomservice" android:permission="string" android:process="string" >... </service>

12 Clients of the service would implement onserviceconnected() and onservicedisconnected() methods so they can be notified when a successful connection to the remote service is established, and when it goes away. They would then call bindservice() to set up the connection. The service's onbind() method would be implemented to either accept or reject the connection, depending on the intent it receives (the intent passed to bindservice()). If the service accepts the connection, Android calls the client's onserviceconnected() method and passes it a proxy. Through the proxy, the client can make calls on the remote service.

13 Java object called IBinder Base interface for a remotable object, the core part of a lightweight remote procedure call mechanism designed for high performance when performing in- process and cross- process calls. This interface describes the abstract protocol for interacting with a remotable object.

14 Component that receives and reacts to broadcast announcements Announcements are Intents No user interface Extends BroadcastReceiver Java class

15 Broadcast receiver registers for announcements Announcement broadcast System identifies recipient and calls onreceive(context,intent) onreceive() implements response

16 You can register it within AndroidManifest.XML Let Android know your application has a Broadcast Receiver component <receiver android:enabled=["true" "false"] android:exported=["true" "false"] android:icon="drawable resource" android:label="string resource" android:name="string" android:permission="string" android:process="string" >... </receiver>

17 Context.registerReceiver(receiver,intentfilter) This registers receiver to watch for intents that match intentfilter

18 SYSTEM announcements Time zone change Battery is low User changed language preferences Picture has been taken

19 * Use the Activity application component Specifically, Context.sendBroadcast(Intent) Sending the broadcast from an Activity would eventually get to the onreceive(intent) function of a particular BroadcastReceiver Java class All receivers matching this Intent will receive the broadcast.

20 Example of on onreceive()

21 Because a process running a service is ranked higher than one with background activities, an activity that initiates a long- running operation might do well to start a service for that operation, rather than simply spawn a thread particularly if the operation will likely outlast the activity. Priority(Service) > Priority(Background)

22 You have a client and server. The client wants to execute a service which only the server can do The client is running in an Android OS process The server is also running in an Android OS process (may or may not be the same as the client s) The client has it s own address space The server has it s own address space The only way these two seemingly independent entities can communicate is with something they share: Android OS

23 Android has a lightweight mechanism for remote procedure calls (RPCs) where a method is called locally, but executed remotely (in another process), with any result returned back to the caller. This entails decomposing the method call and all its attendant data to a level the operating system can understand, transmitting it from the local process and address space to the remote process and address space, and reassembling and reenacting the call there. Return values have to be transmitted in the opposite direction. Android provides all the code to do that work, so that you can concentrate on defining and implementing the RPC interface itself

24

25 AIDL (Android Interface Definition Language) is an IDL language used to generate code that enables two processes on an Android- powered device to talk using interprocess communication (IPC). If you have code in one process (for example, in an Activity) that needs to call methods on an object in another process (for example, a Service), you would use AIDL to generate code to marshall the parameters.

26 package com.example.android.apis.app; /** * Example of a secondary interface associated with a service. (Note that * the interface itself doesn't impact, it is just a matter of how you * retrieve it from the service.) */ interface ISecondary { /** * Request the PID of this service, to do evil things with it. */ int getpid(); /** * This demonstrates the basic types that you can use as parameters * and return values in AIDL. */ void basictypes(int anint, long along, boolean aboolean, float afloat, double adouble, String astring); }

27 161 lines of Java code Thanks to AIDL Tool (which Eclipse ADT Plugin automatically configured to use) You can also create this Java file by going to $ANDROID_SDK/tools/aidl <input=isecondary.aidl>

28

29 Includes an abstract inner class named Stub that declares all the methods that you declared in your.aidl file Stub also defines a few helper methods: asinterface() - takes an IBinder (passed to a client's onserviceconnected() implementation when applicationcontext.bindservice() succeeds), and returns an instance of the interface used to call the IPC methods

30 To implement your interface, extend YourInterface.Stub, and implement the methods. Where YourInterface = ISecondary.Stub for our example

31

32 No exceptions that you throw will be sent back to the caller. By default, IPC calls are synchronous. If you know that an IPC service takes more than a few milliseconds to complete, you should not call it in the Activity/View thread, because it might hang the application (Android might display an "Application is Not Responding" dialog). Try to call them in a separate thread. Only methods are supported; you cannot declare static fields in an AIDL interface.

33 Publish it Inherit Service and implement Service.onBind(Intent) to return an instance of the class that implements your interface.

34

35 STEP #1: Declare a variable of the interface type that your.aidl file defined. msecondaryservice = ISecondary.Stub.asInterface(service);

36 STEP #2: Implement ServiceConnection. Interface for monitoring the state of an application service. Basically implement onserviceconnected() and onservicedisconnected()

37 STEP #3: Call Context.bindService(), passing in your ServiceConnection implementation in step #2

38 STEP #4: In your implementation of ServiceConnection.onServiceConnected(), you will receive an IBinder instance (called service). Call YourInterfaceName.Stub.asInterface((IBinder) service) to cast the returned parameter to YourInterface type.

39

40 Step #5: Call the methods that you defined on your interface. You should always trap DeadObjectException exceptions, which are thrown when the connection has broken; this will be the only exception thrown by remote methods.

41

42 Step #6: To disconnect, call Context.unbindService() with the instance of your interface.

43 None of the previous slides would matter if you do not have permission to bind to a service

44 mechanism that enforces restrictions on the specific operations that a particular process can perform

45 An application's process runs in a security sandbox. The sandbox is designed to prevent applications from disrupting each other, except by explicitly declaring the permissions they need for additional capabilities not provided by the basic sandbox.

46 If you want others to access your application s DeadlyActivity it needs to defined in AndroidManifest.xml Example:

47 Client wants to add two numbers Client wants to connect to the service that does that. Write a service that will accept two integers, add them, and return the sum to the client. Additionally, the server app will be listening for clients connecting and requesting its service. When a client connects to it, the server app will send out a broadcast announcement saying a client has connected. Your client app should receive this announcement and print an alert message on its screen

The Broadcast Class Registration Broadcast Processing

The Broadcast Class Registration Broadcast Processing The Broadcast Class Registration Broadcast Processing Base class for components that receive and react to events BroadcastReceivers register to receive events in which they are interested When Events occur

More information

Android Services & Local IPC: Overview of Programming Bound Services

Android Services & Local IPC: Overview of Programming Bound Services : Overview of Programming Bound Services d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Professor of Computer Science Institute for Software Integrated Systems Vanderbilt University Nashville,

More information

Services. Background operating component without a visual interface Running in the background indefinitely

Services. Background operating component without a visual interface Running in the background indefinitely Services Background operating component without a visual interface Running in the background indefinitely Differently from Activity, Service in Android runs in background, they don t have an interface

More information

EMBEDDED SYSTEMS PROGRAMMING Android Services

EMBEDDED SYSTEMS PROGRAMMING Android Services EMBEDDED SYSTEMS PROGRAMMING 2016-17 Android Services APP COMPONENTS Activity: a single screen with a user interface Broadcast receiver: responds to system-wide broadcast events. No user interface Service:

More information

Services are software components designed specifically to perform long background operations.

Services are software components designed specifically to perform long background operations. SERVICES Service Services are software components designed specifically to perform long background operations. such as downloading a file over an internet connection or streaming music to the user, but

More information

ANDROID SERVICES, BROADCAST RECEIVER, APPLICATION RESOURCES AND PROCESS

ANDROID SERVICES, BROADCAST RECEIVER, APPLICATION RESOURCES AND PROCESS ANDROID SERVICES, BROADCAST RECEIVER, APPLICATION RESOURCES AND PROCESS 1 Instructor: Mazhar Hussain Services A Service is an application component that can perform long-running operations in the background

More information

CS378 -Mobile Computing. Services and Broadcast Receivers

CS378 -Mobile Computing. Services and Broadcast Receivers CS378 -Mobile Computing Services and Broadcast Receivers Services One of the four primary application components: activities content providers services broadcast receivers 2 Services Application component

More information

MOBILE APPLICATION DEVELOPMENT LECTURE 10 SERVICES IMRAN IHSAN ASSISTANT PROFESSOR

MOBILE APPLICATION DEVELOPMENT LECTURE 10 SERVICES IMRAN IHSAN ASSISTANT PROFESSOR MOBILE APPLICATION DEVELOPMENT LECTURE 10 SERVICES IMRAN IHSAN ASSISTANT PROFESSOR WWW.IMRANIHSAN.COM Android Component A Service is an application component that runs in the background, not interacting

More information

Android Fundamentals - Part 1

Android Fundamentals - Part 1 Android Fundamentals - Part 1 Alexander Nelson September 1, 2017 University of Arkansas - Department of Computer Science and Computer Engineering Reminders Projects Project 1 due Wednesday, September 13th

More information

Services. service: A background task used by an app.

Services. service: A background task used by an app. CS 193A Services This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. Services service: A background task

More information

Android Architecture and Binder. Dhinakaran Pandiyan Saketh Paranjape

Android Architecture and Binder. Dhinakaran Pandiyan Saketh Paranjape Android Architecture and Binder Dhinakaran Pandiyan Saketh Paranjape Android Software stack Anatomy of an Android application Activity UI component typically corresponding of one screen Service Background

More information

Android. Broadcasts Services Notifications

Android. Broadcasts Services Notifications Android Broadcasts Services Notifications Broadcast receivers Application components that can receive intents from other applications Broadcast receivers must be declared in the manifest They have an associated

More information

Android System Development Day-4. Team Emertxe

Android System Development Day-4. Team Emertxe Android System Development Day-4 Team Emertxe Android System Service Table of Content Introduction to service Inter Process Communication (IPC) Adding Custom Service Writing Custom HAL Compiling SDK Testing

More information

Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5

Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5 1 Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5 Prof. Hwansoo Han T.A. Sung-in Hong T.A. Minseop Jeong 2 Background processing Every Android app has a main

More information

Android Services & Local IPC: The Command Processor Pattern (Part 1)

Android Services & Local IPC: The Command Processor Pattern (Part 1) : The Command Processor Pattern (Part 1) d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Professor of Computer Science Institute for Software Integrated Systems Vanderbilt University Nashville,

More information

Termite WiFi Direct API

Termite WiFi Direct API Termite WiFi Direct API Developers Guide 2014/15 Nuno Santos 1. Objectives This document provides a brief description of the Termite WiFi Direct API. 2. Termite API Guide In order for an application to

More information

Security Philosophy. Humans have difficulty understanding risk

Security Philosophy. Humans have difficulty understanding risk Android Security Security Philosophy Humans have difficulty understanding risk Safer to assume that Most developers do not understand security Most users do not understand security Security philosophy

More information

Services & Interprocess Communication (IPC) CS 282 Principles of Operating Systems II Systems Programming for Android

Services & Interprocess Communication (IPC) CS 282 Principles of Operating Systems II Systems Programming for Android Services & Interprocess Communication (IPC) CS 282 Principles of Operating Systems II Systems Programming for Android A Service is an application component that can perform longrunning operations in the

More information

Safety First - Android sicher programmieren! Benjamin Reimold & Stephan Linzner

Safety First - Android sicher programmieren! Benjamin Reimold & Stephan Linzner 2011 Safety First - Android sicher programmieren! Benjamin Reimold & Stephan Linzner 7th July, 2011 Introducing Stephan Linzner Benjamin Reimold Freelance Software Engineer Mobile Developer Founder of

More information

Mobile Computing. Introduction to Android

Mobile Computing. Introduction to Android Mobile Computing Introduction to Android Mobile Computing 2011/2012 What is Android? Open-source software stack for mobile devices OS, middleware and key applications Based upon a modified version of the

More information

PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY:

PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY: PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY: K.VENU 10JE1A0555 Venu0555@gmail.com B.POTHURAJU 10JE1A0428 eswr10je1a0410@gmail.com ABSTRACT early prototypes, basic building blocks of an android

More information

COLLEGE OF ENGINEERING, NASHIK-4

COLLEGE OF ENGINEERING, NASHIK-4 Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4 DEPARTMENT OF COMPUTER ENGINEERING 1) What is Android? Important Android Questions It is an open-sourced operating system that is used primarily

More information

Application Fundamentals

Application Fundamentals Application Fundamentals CS 2046 Mobile Application Development Fall 2010 Announcements CMS is up If you did not get an email regarding this, see me after class or send me an email. Still working on room

More information

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015 Android System Architecture Android Application Fundamentals Applications in Android All source code, resources, and data are compiled into a single archive file. The file uses the.apk suffix and is used

More information

Questions and Answers. Q.1) Which of the following is the most ^aeuroeresource hungry ^aeuroepart of dealing with activities on android?

Questions and Answers. Q.1) Which of the following is the most ^aeuroeresource hungry ^aeuroepart of dealing with activities on android? Q.1) Which of the following is the most ^aeuroeresource hungry ^aeuroepart of dealing with activities on android? A. Closing an app. B. Suspending an app C. Opening a new app D. Restoring the most recent

More information

Android Ecosystem and. Revised v4presenter. What s New

Android Ecosystem and. Revised v4presenter. What s New Android Ecosystem and Revised v4presenter What s New Why Mobile? 5B 4B 3B 2B 1B Landlines PCs TVs Bank users Mobiles 225M AOL 180M 135M 90M 45M 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Quarters

More information

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar Design Patterns MSc in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie)! Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Two Phase Commit Protocol. Distributed Systems. Remote Procedure Calls (RPC) Network & Distributed Operating Systems. Network OS.

Two Phase Commit Protocol. Distributed Systems. Remote Procedure Calls (RPC) Network & Distributed Operating Systems. Network OS. A distributed system is... Distributed Systems "one on which I cannot get any work done because some machine I have never heard of has crashed". Loosely-coupled network connection could be different OSs,

More information

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API Recap: Finger Table Finding a using fingers CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo N102" 86 + 2 4! N86" 20 +

More information

Lecture 08. Android Permissions Demystified. Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner. Operating Systems Practical

Lecture 08. Android Permissions Demystified. Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner. Operating Systems Practical Lecture 08 Android Permissions Demystified Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner Operating Systems Practical 20 November, 2013 OSP Lecture 08, Android Permissions Demystified

More information

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Lecture 3: Android Life Cycle and Permission Entire Lifetime An activity begins its lifecycle when entering the oncreate() state If not interrupted

More information

Android permissions Defining and using permissions Component permissions and related APIs

Android permissions Defining and using permissions Component permissions and related APIs Android permissions Defining and using permissions Component permissions and related APIs Permissions protects resources and data For instance, they limit access to: User information e.g, Contacts Cost-sensitive

More information

Services. Marco Ronchetti Università degli Studi di Trento

Services. Marco Ronchetti Università degli Studi di Trento 1 Services Marco Ronchetti Università degli Studi di Trento Service An application component that can perform longrunning operations in the background and does not provide a user interface. So, what s

More information

Configuring the Android Manifest File

Configuring the Android Manifest File Configuring the Android Manifest File Author : userone What You ll Learn in This Hour:. Exploring the Android manifest file. Configuring basic application settings. Defining activities. Managing application

More information

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Lecture 3: Android Life Cycle and Permission Android Lifecycle An activity begins its lifecycle when entering the oncreate() state If not

More information

LECTURE 12 BROADCAST RECEIVERS

LECTURE 12 BROADCAST RECEIVERS MOBILE APPLICATION DEVELOPMENT LECTURE 12 BROADCAST RECEIVERS IMRAN IHSAN ASSISTANT PROFESSOR WWW.IMRANIHSAN.COM Application Building Blocks Android Component Activity UI Component Typically Corresponding

More information

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement. CSCE 315: Android Lectures (1/2) Dr. Jaerock Kwon App Development for Mobile Devices Jaerock Kwon, Ph.D. Assistant Professor in Computer Engineering App Development for Mobile Devices Jaerock Kwon, Ph.D.

More information

INTRODUCTION TO ANDROID

INTRODUCTION TO ANDROID INTRODUCTION TO ANDROID 1 Niv Voskoboynik Ben-Gurion University Electrical and Computer Engineering Advanced computer lab 2015 2 Contents Introduction Prior learning Download and install Thread Android

More information

Programming in Android. Nick Bopp

Programming in Android. Nick Bopp Programming in Android Nick Bopp nbopp@usc.edu Types of Classes Activity This is the main Android class that you will be using. These are actively displayed on the screen and allow for user interaction.

More information

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml Android Application Written in Java (it s possible to write native code) Good

More information

Programming with Android: Notifications, Threads, Services. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna

Programming with Android: Notifications, Threads, Services. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna Programming with Android: Notifications, Threads, Dipartimento di Scienze dell Informazione Università di Bologna Outline Notification : Status Bar Notifications Notification : Toast Notifications Thread

More information

Lecture 2 Android SDK

Lecture 2 Android SDK Lecture 2 Android SDK This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a

More information

Android Application Development

Android Application Development Android Application Development Octav Chipara What is Android A free, open source mobile platform A Linux-based, multiprocess, multithreaded OS Android is not a device or a product It s not even limited

More information

Android Software Development Kit (Part I)

Android Software Development Kit (Part I) Android Software Development Kit (Part I) Gustavo Alberto Rovelo Ruiz October 29th, 2010 Look & Touch Group 2 Presentation index What is Android? Android History Stats Why Andriod? Android Architecture

More information

BINDER THE ANDROID IPC FRAMEWORK. Antoine 'xdbob' Damhet. July 15, 2016

BINDER THE ANDROID IPC FRAMEWORK. Antoine 'xdbob' Damhet. July 15, 2016 BINDER THE ANDROID IPC FRAMEWORK Antoine 'xdbob' Damhet July 15, 2016 1 THE INTERPROCESS COMMUNICATION Share memory Share privileges Call a remote functions (RPC) Synchronize the processes 2 THE GOAL 3

More information

Multiple Activities. Many apps have multiple activities

Multiple Activities. Many apps have multiple activities Intents Lecture 7 Multiple Activities Many apps have multiple activities An activity A can launch another activity B in response to an event The activity A can pass data to B The second activity B can

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Last Class: RPCs. Today:

Last Class: RPCs. Today: Last Class: RPCs RPCs make distributed computations look like local computations Issues: Parameter passing Binding Failure handling Lecture 8, page 1 Today: Lightweight RPCs Remote Method Invocation (RMI)

More information

JAVA RMI. Remote Method Invocation

JAVA RMI. Remote Method Invocation 1 JAVA RMI Remote Method Invocation 2 Overview Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space. The other address space could be: On the same

More information

Implementing a Download Background Service

Implementing a Download Background Service 1 Implementing a Download Background Service Android Services Stefan Tramm Patrick Bönzli Android Experience Day, FHNW 2008-12-03 2 Agenda Part I: Business Part the application some screenshots Part II:

More information

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012 ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012 AGENDA Android v. ios Design Paradigms Setup Application Framework Demo Libraries Distribution ANDROID V. IOS Android $25 one-time

More information

Software Practice 3 Today s lecture Today s Task

Software Practice 3 Today s lecture Today s Task 1 Software Practice 3 Today s lecture Today s Task Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 MULTITHREAD IN ANDROID 3 Activity and Service before midterm after midterm 4 Java Thread Thread is an execution

More information

Array. Prepared By - Rifat Shahriyar

Array. Prepared By - Rifat Shahriyar Java More Details Array 2 Arrays A group of variables containing values that all have the same type Arrays are fixed length entities In Java, arrays are objects, so they are considered reference types

More information

CS378 -Mobile Computing. Intents

CS378 -Mobile Computing. Intents CS378 -Mobile Computing Intents Intents Allow us to use applications and components that are part of Android System and allow other applications to use the components of the applications we create Examples

More information

Objective Questions. BCA Part III Paper XIX (Java Programming) page 1 of 5

Objective Questions. BCA Part III Paper XIX (Java Programming) page 1 of 5 Objective Questions BCA Part III page 1 of 5 1. Java is purely object oriented and provides - a. Abstraction, inheritance b. Encapsulation, polymorphism c. Abstraction, polymorphism d. All of the above

More information

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle CS378 - Mobile Computing Anatomy of an Android App and the App Lifecycle Application Components five primary components different purposes and different lifecycles Activity single screen with a user interface,

More information

BITalino Java Application Programming Interface. Documentation Android API

BITalino Java Application Programming Interface. Documentation Android API BITalino Java Application Programming Interface Documentation Android API Contents Contents...2 1. General Information...3 2. Introduction...4 3. Main Objects...5 3.1.Class BITalinoDescription...5 3.2.Class

More information

CHAPTER 3 - PROCESS CONCEPT

CHAPTER 3 - PROCESS CONCEPT CHAPTER 3 - PROCESS CONCEPT 1 OBJECTIVES Introduce a process a program in execution basis of all computation Describe features of processes: scheduling, creation, termination, communication Explore interprocess

More information

Informatica 3. Marcello Restelli. Laurea in Ingegneria Informatica Politecnico di Milano 9/15/07 10/29/07

Informatica 3. Marcello Restelli. Laurea in Ingegneria Informatica Politecnico di Milano 9/15/07 10/29/07 Informatica 3 Marcello Restelli 9/15/07 10/29/07 Laurea in Ingegneria Informatica Politecnico di Milano Structuring the Computation Control flow can be obtained through control structure at instruction

More information

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle CS378 -Mobile Computing Anatomy of and Android App and the App Lifecycle Hello Android Tutorial http://developer.android.com/resources/tutorials/hello-world.html Important Files src/helloandroid.java Activity

More information

ITG Software Engineering

ITG Software Engineering Android Security Course ID: Page 1 Last Updated 12/15/2014 Android Security ITG Software Engineering Course Overview: This 5 day course covers the Android architecture, the stack, and primary building

More information

Programming Android UI. J. Serrat Software Design December 2017

Programming Android UI. J. Serrat Software Design December 2017 Programming Android UI J. Serrat Software Design December 2017 Preliminaries : Goals Introduce basic programming Android concepts Examine code for some simple examples Limited to those relevant for the

More information

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE

More information

CSci Introduction to Distributed Systems. Communication: RPC

CSci Introduction to Distributed Systems. Communication: RPC CSci 5105 Introduction to Distributed Systems Communication: RPC Today Remote Procedure Call Chapter 4 TVS Last Time Architectural styles RPC generally mandates client-server but not always Interprocess

More information

CS 403X Mobile and Ubiquitous Computing Lecture 5: Web Services, Broadcast Receivers, Tracking Location, SQLite Databases Emmanuel Agu

CS 403X Mobile and Ubiquitous Computing Lecture 5: Web Services, Broadcast Receivers, Tracking Location, SQLite Databases Emmanuel Agu CS 403X Mobile and Ubiquitous Computing Lecture 5: Web Services, Broadcast Receivers, Tracking Location, SQLite Databases Emmanuel Agu Web Services What are Web Services? Means to call a remote method

More information

Around Android. Essential Android features illustrated by a walk through a practical example

Around Android. Essential Android features illustrated by a walk through a practical example Around Android Essential Android features illustrated by a walk through a practical example By Stefan Meisner Larsen, Trifork. sml@trifork.dk. Twitter: stefanmeisner Agenda Introduction to MoGuard Alert

More information

CS 151. Exceptions & Javadoc. slides available on course website. Sunday, September 9, 12

CS 151. Exceptions & Javadoc. slides available on course website. Sunday, September 9, 12 CS 151 Exceptions & Javadoc slides available on course website 1 Announcements Prelab 1 is due now. Please place it in the appropriate (Mon vs. Tues) box. Please attend lab this week. There may be a lecture

More information

App Development for Android. Prabhaker Matet

App Development for Android. Prabhaker Matet App Development for Android Prabhaker Matet Development Tools (Android) Java Java is the same. But, not all libs are included. Unused: Swing, AWT, SWT, lcdui Android Studio (includes Intellij IDEA) Android

More information

application components

application components What you need to know for Lab 1 code to publish workflow application components activities An activity is an application component that provides a screen with which users can interact in order to do something,

More information

Exceptions. What exceptional things might our programs run in to?

Exceptions. What exceptional things might our programs run in to? Exceptions What exceptional things might our programs run in to? Exceptions do occur Whenever we deal with programs, we deal with computers and users. Whenever we deal with computers, we know things don

More information

1. What are the key components of Android Architecture? 2. What are the advantages of having an emulator within the Android environment?

1. What are the key components of Android Architecture? 2. What are the advantages of having an emulator within the Android environment? 1. What are the key components of Android Architecture? Android Architecture consists of 4 key components: - Linux Kernel - Libraries - Android Framework - Android Applications 2. What are the advantages

More information

Permissions. Lecture 18

Permissions. Lecture 18 Permissions Lecture 18 Topics related Android permissions Defining & using applica:on permissions Component permissions Permissions Android protects resources & data with permissions Example: who has the

More information

Lecture 3 Android Internals

Lecture 3 Android Internals Lecture 3 Android Internals This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or

More information

Chapter 3: Processes. Operating System Concepts 9 th Edition

Chapter 3: Processes. Operating System Concepts 9 th Edition Chapter 3: Processes Silberschatz, Galvin and Gagne 2013 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information

Interprocess Communication

Interprocess Communication Interprocess Communication Reading: Silberschatz chapter 4 Additional Reading: Stallings chapter 6 EEL 358 1 Outline Introduction Shared memory systems POSIX shared memory Message passing systems Direct

More information

Android Security Lab WS 2013/14 Lab 2: Android Permission System

Android Security Lab WS 2013/14 Lab 2: Android Permission System Saarland University Information Security & Cryptography Group Prof. Dr. Michael Backes saarland university computer science Android Security Lab WS 2013/14 M.Sc. Sven Bugiel Version 1.2 (November 12, 2013)

More information

5 Distributed Objects: The Java Approach

5 Distributed Objects: The Java Approach 5 Distributed Objects: The Java Approach Main Points Why distributed objects Distributed Object design points Java RMI Dynamic Code Loading 5.1 What s an Object? An Object is an autonomous entity having

More information

CMSC 330: Organization of Programming Languages. Threads Classic Concurrency Problems

CMSC 330: Organization of Programming Languages. Threads Classic Concurrency Problems : Organization of Programming Languages Threads Classic Concurrency Problems The Dining Philosophers Problem Philosophers either eat or think They must have two forks to eat Can only use forks on either

More information

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1 Message Passing vs. Distributed Objects 5/15/2009 Distributed Computing, M. L. Liu 1 Distributed Objects M. L. Liu 5/15/2009 Distributed Computing, M. L. Liu 2 Message Passing versus Distributed Objects

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

OFFLINE MODE OF ANDROID

OFFLINE MODE OF ANDROID OFFLINE MODE OF ANDROID APPS @Ajit5ingh ABOUT ME new Presenter( Ajit Singh, github.com/ajitsing, www.singhajit.com, @Ajit5ingh ) AGENDA Why offline mode? What it takes to build an offline mode Architecture

More information

Chapter 4: Processes. Process Concept

Chapter 4: Processes. Process Concept Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems 4.1 Silberschatz, Galvin and Gagne

More information

Android Services & Local IPC: The Activator Pattern (Part 2)

Android Services & Local IPC: The Activator Pattern (Part 2) : The Activator Pattern (Part 2) d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Professor of Computer Science Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee,

More information

Chapter 4: Processes

Chapter 4: Processes Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems 4.1 Silberschatz, Galvin and Gagne

More information

CSc 335 Inheritance Hell

CSc 335 Inheritance Hell CSc 335 Inheritance Hell Inheritance Hell refers to seemingly complex and contradictory behavior by the compiler and runtime system when resolving types and methods in an inheritance hierarchy. However,

More information

Android App Development

Android App Development Android App Development Outline Introduction Android Fundamentals Android Studio Tutorials Introduction What is Android? A software platform and operating system for mobile devices Based on the Linux kernel

More information

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore Android App Development Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore Mobile devices (e.g., smartphone, tablet PCs, etc.) are increasingly becoming an essential part of human life

More information

SHWETANK KUMAR GUPTA Only For Education Purpose

SHWETANK KUMAR GUPTA Only For Education Purpose Introduction Android: INTERVIEW QUESTION AND ANSWER Android is an operating system for mobile devices that includes middleware and key applications, and uses a modified version of the Linux kernel. It

More information

Android Programmierung leichtgemacht. Lars Vogel

Android Programmierung leichtgemacht. Lars Vogel Android Programmierung leichtgemacht Lars Vogel Twitter: @vogella Lars Vogel Arbeitet als unabhängiger Eclipse und Android Berater und Trainer Arbeit zusätzlichen für SAP AG als Product Owner in einem

More information

2017 Pearson Educa2on, Inc., Hoboken, NJ. All rights reserved.

2017 Pearson Educa2on, Inc., Hoboken, NJ. All rights reserved. Operating Systems: Internals and Design Principles Chapter 4 Threads Ninth Edition By William Stallings Processes and Threads Resource Ownership Process includes a virtual address space to hold the process

More information

Java Threads. COMP 585 Noteset #2 1

Java Threads. COMP 585 Noteset #2 1 Java Threads The topic of threads overlaps the boundary between software development and operation systems. Words like process, task, and thread may mean different things depending on the author and the

More information

ANDROID MOCK TEST ANDROID MOCK TEST IV

ANDROID MOCK TEST ANDROID MOCK TEST IV http://www.tutorialspoint.com ANDROID MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Android. You can download these sample mock tests at your local

More information

Android Overview. Most of the material in this section comes from

Android Overview. Most of the material in this section comes from Android Overview Most of the material in this section comes from http://developer.android.com/guide/ Android Overview A software stack for mobile devices Developed and managed by Open Handset Alliance

More information

Introduction to Android

Introduction to Android Introduction to Android Ambient intelligence Teodoro Montanaro Politecnico di Torino, 2016/2017 Disclaimer This is only a fast introduction: It is not complete (only scrapes the surface) Only superficial

More information

Kratos: Discovering Inconsistent Security Policy Enforcement in the Android Framework

Kratos: Discovering Inconsistent Security Policy Enforcement in the Android Framework Kratos: Discovering Inconsistent Security Policy Enforcement in the Android Framework Yuru Shao, Jason Ott, Qi Alfred Chen, Zhiyun Qian, Z. Morley Mao University of Michigan, University of California Riverside

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Threads Synchronization Refers to mechanisms allowing a programmer to control the execution order of some operations across different threads in a concurrent

More information

Android Services. Victor Matos Cleveland State University. Services

Android Services. Victor Matos Cleveland State University. Services 22 Android Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html 22. Android Android A Service is an application component that runs in

More information

Java WebStart, Applets & RMI

Java WebStart, Applets & RMI Java WebStart, Applets & RMI 11-13-2013 Java WebStart & Applets RMI Read: Java Web Start Tutorial Doing More with Rich Internet Applications Java Web Start guide Exam#2 is scheduled for Tues., Nov. 19,

More information

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license Android Android Mobile operating system developed by Google A complete stack OS, framework A rich set of applications Email, calendar, browser, maps, text messaging, contacts, camera, dialer, music player,

More information

Data Management CS 4720 Mobile Application Development

Data Management CS 4720 Mobile Application Development Data Management Mobile Application Development Desktop Applications What are some common applications you use day-to-day? Browser (Chrome, Firefox, Safari, etc.) Music Player (Spotify, itunes, etc.) Office

More information