Overview. Lecture: Implicit Calling via Share Implicit Receiving via Share Launch Telephone Launch Settings Homework

Size: px
Start display at page:

Download "Overview. Lecture: Implicit Calling via Share Implicit Receiving via Share Launch Telephone Launch Settings Homework"

Transcription

1 Implicit Intents

2 Overview Lecture: Implicit Calling via Share Implicit Receiving via Share Launch Telephone Launch Settings Homework

3 Intents Intent asynchronous message used to activate one Android component using another Intent - A Task that is to be performed Triggers the OS that something has occurred and an action needs to be taken The OS, based on the data received, determines the receiver for the intent Implicit Trigger general components of a category through Android OS (OS decides / user chooses)

4 Implicit Intents Implicit Intents - do not directly specify the Android component to be activated Only specify the action to be performed We will create an activity with several buttons to try our implicit intents Each button will fire-off a different intent ACTION

5 Intents and the Manifest The manifest can have Intent Filters Require some conditions to be fulfilled to process the intent Information about the data and category of the Intent Identities the behavior of an Android Intent

6 Parts of an Intent 1. Component What component can safetly handle the intent: 1. CATEGORY_LAUNCHER 2. CATEGORY_BROWSER 2. Actions What the intent will cause: 1. ACTION_CALL 2. ACTION_BATTERY_LOW 3. ACTION_SCREEN_ON 3. Data Assists the action where information is necessary, such as the phone number to dial 4. Extras key-value pairs for when additional data is needed to fulfill the task

7 Example Intent Rolls Wi-Fi & Bluetooth Ability to change the wi-fi / Bluetooth connection while inside the application Camera Opening the camera app and receiving image data back GPS Sensor Extraction of current location of the user (if they let you) SMS/MMS Sending messages through native applications Time Zone changes

8 Implicit Intents - Actions Some common intent actions: Activity 2 activity data transfer View a website Launch Telephone with number Work with Contacts Use Camera Work with Calendar or Alarm Clock Text Message Create a Note Play Media Show a location on a Map Compose an Connect with Wi-Fi / Bluetooth And more

9 Side Note - Service Services perform specific tasks in the background They don t have a UI & run on the main thread of the app They run in the background even when another app is visible Great for IPC, networking, music, file I/O We can start and stop services using explicit intents We ll get back to Services later

10 Implicit Intents Sharing Text Create a new project Implicit Intents Add several buttons to launch other activities/intents We will share content to other apps that support Text/Plain data This is done through the intent constructor: Intent intent = new Intent(Intent.ACTION_SEND);

11 Implicit Intents - Sharing Create activity (ShareIntentActivity) Create a layout with a plain text edit field Add a button with the text share We don t need any special permission in the manifest since we will be sending out a share intent If we wanted our app to respond to share intents, we d need to modify the manifest

12 Implicit Intents - Sharing Open the activity code Grab the edit text and button reference Create an anonymous onclicklistener for the button Grab the edit text using: String msg = edittext.gettext().tostring();

13 Implicit Intents - Sharing Button button; EditText protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.activity_share_intent); button = (Button)findViewById(R.id.button_share); edittext = (EditText)findViewById(R.id.editText_share); button.setonclicklistener(new public void onclick(view v) { String message = edittext.gettext().tostring(); //continued code }});}

14 Implicit Intents - Sharing Using the Intent Action ACTION_SEND we can send information out of our application to other compatible applications We send data by specifying the data type, in this case text/plain If we only pass the intent, Android may automatically run the application that is compatible We can force the chooser and provide a title But what if there are no apps to respond?

15 Implicit Intents No Apps to Respond? If there are no apps to run the intent, our app will CRASH! Verify an app exists by calling: intent.resolveactivity(pm) If the result!= null, we are good to call startactivity() Intent intent = new Intent(Intent.ACTION_SEND) in.putextra(intent.extra_text, msg); in.settype( text/plain ); ComponentName name = in.resolveactivity(getpackagemanager());

16 Implicit Intents Package Manager How about another way? We query for compatible activates, check if the list > 0 and process: PackageManager packagemanager = getpackagemanager(); List activities = packagemanager.queryintentactivities( intent, PackageManager.MATCH_DEFAULT_ONLY); boolean isintentsafe = activities.size() > 0;

17 Implicit Intents - Sharing Create a new intent with the action to send: if(componentname!= null) startactivity(intent.createchooser(in, Share via )); else { } Toast.makeText(ShareIntentActivity.this, No activity found to handle sending plain text., Toast.LENGTH_LONG).show();

18 Implicit Intents - Sharing The settype method takes a MIME type, lowercase only Multipurpose Internet Mail Extension Relates filenames to a short text description: HTML text/html CSS text/css Search online for a list of types:

19 Implicit Intents Becoming a Choice Let s become a choice! Create a new blank activity with textview and go to manifest Add new intent filter for the activity: <activity android:name=.receiveshareactivity > <intent-filter> <action android:name= android.intent.action.send /> <category android:name= android.intent.category.default /> <data android:mimetype= text/plain /> </intent-filter> </activity> The mimetype helps determine what choosers can support this send request, try text/html and see the list differences!

20 Implicit Intents Becoming a Choice We now need to handle receiving an intent and pull the attached data When app launched from chooser, oncreate method is called We can get access to the intent that was supplied by calling: Intent intent = getintent(); String action = intent.getaction(); String type = intent.gettype();

21 Implicit Intents Becoming a Choice Check the action type to see if we can handle this intent & set our TextView s text: if(intent.action_send.equals(action) && type!= null) { if("text/plain".equals(type)){ String extratext = intent.getstringextra(intent.extra_text); } if(text!= null) text.settext(extratext); }

22 Implicit Intents Becoming a Choice

23 Implicit Intents Launching Telephone Let s launch an App to call our favorite pizza shop: Change our old layout: Dialing a number doesn t require permission Calling a number automatically DOES require a permission: <uses-permission android:name= android.permi ssion.call_phone />

24 Implicit Intents Launching Telephone Get a reference to the button Create a new method in our main activity to be called by button listener button_emergencypizza.setonclicklistener(new View.OnClickListener() public void onclick(view v) { Intent intent = new Intent(Intent.ACTION_DIAL); intent.setdata(uri.parse("tel: :")); if(intent.resolveactivity(getpackagemanager())!=null) startactivity(intent); }});

25 Implicit Intents Launching Settings As we start implementing features, we need to ask the user to turn on settings (wifi, location, nfc, Bluetooth, etc ) We can perform system setting actions such as: ACTION_SETTINGS ACTION_WIRELESS_SETTINGS ACTION_AIRPLANE_MODE_SETTINGS ACTION_WIFI_SETTINGS ACTION_BLUETOOTH_SETTINGS ACTION_LOCALE_SETTINGS ACTION_DISPLAY_SETTINGS ACTION_SECURITY_SETTINGS ACTION_LOCATION_SOURCE_SETTINGS ACTION_INTERNAL_STORATE_SETTINGS ACTION_MEMORY_CARD_SETTINGS

26 Implicit Intents Launching Settings Make a new button called wireless settings Grab a reference to the button and onclick the following: button_wireless.setonclicklistener(new View.OnClickListener() public void onclick(view v) { Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS); if(intent.resolveactivity(getpackagemanager())!=null) startactivity(intent); }});

27 ListView A ListView will host only enough entries for what is visible on the screen + 2 Even if we have items, the ListView will only generate what is needed It will recycle old elements to conserve resources A ListView and GridView are both children of the AdapterView We need something to convert our data arrays into ListView entries View 0 View 1 View 2 View 3 View 4 View 5

28 ListView + Adapters An Adapter will handle converting our data into a format that ListView or GridView can use to populate the screen We bind the adapter to the AdapterView Two common Adapters include: ArrayAdapter for array data sources, calling tostring on each element to create a view SimpleCursorAdapter when using cursors, such as from Contacts or other databases

29 Adapters Create an adapter specifying the type of the object being contained: ArrayAdapter<String> new ArrayAdapter<String>( this, android.r.layout.simple_list_item_1, mystringarray); Arguments: context, a TextView layout to use for views and the array of objects Call setadapter() on the ListView: ListView lv = (ListView) findviewbyid(r.id.listview); listview.setadapter(adapter);

30 ArrayAdapter The adapter is responsible for: 1. Creating the view object 2. Populating the view object with data 3. Returning the view object to the ListView An adapter can be any class that implements the Adapter interface ArrayAdapters<T> knows how to work with data stored in arrays OR lists!

31 Adapter Example listview =(ListView) findviewbyid(r.id.listview); String[] strings = {"Hello", "mother", "hello", "father", "here", "I", "am"}; ArrayAdapter<String> arrayadapter = new ArrayAdapter<String>( this, android.r.layout.simple_list_item _1, strings); listview.setadapter(arrayadapter);

32 ArrayAdapter The adapter and the ListView will have a conversation: ListView: How many items do you have? (getcount) Adapter: I have 3 items ListView: Send me View0 Adapter: (getview) create, populate & return View0 ListView: Send me View1 Adapter: (getview) create, populate & return View1 ListView: Send me View2 Adapter: (getview) create, populate & return View2

33 ArrayAdapter What if we are using other objects and not Strings? The default implementation of ArrayAdapter<T> will use the tostring() method of the data object to populate the view We the tostring() method if we are using our own data type Else: fully-qualified class name and memory address in the list view

34 ArrayAdapter private class Transaction{ private double amount; private String location; public Transaction(int number, double amount, String location){ this.number = number; this.amount = amount; this.location = location; public String tostring() { return "Number: " + this.number + "\namount: " + amount + "\nlocation: " + location; } }

35 Custom TextView We can also create our own TextView for the ListView Allow us to affect the text style, color, gravity, etc: Create an new layout called: textview_test Alter the properties to your liking Use this view layout when creating the ArrayAdapter: ArrayAdapter<Transaction> arrayadapter = new ArrayAdapter<Transaction>( this, R.layout.test_text_view, transactions);

36 Custom TextView We can also create our own TextView for the ListView Allow us to affect the text style, color, gravity, etc: Create an new layout called: textview_test Alter the properties to your liking Use this view layout when creating the ArrayAdapter:

37 List Fragment To handle list item clicks, Override the onlistitemclick public void onlistitemclick(listview l, View v, int position, long id) The ListView clicked The view in the list view clicked The view s position in the list The row id of the item clicked

38 ArrayAdapter Extended If we want more than a text view, we will need to implement our own version of ArrayAdapter 1. Create a new custom layout for the list item 2. Create a new class that inherits from ArrayAdapter 3. Our ArrayAdapter class must be able to: 1. Create 2. Populate 3. Return the new layout

39 ArrayAdapter Extended Custom Layout with a Linear Layout, image, checkbox and text area: Create a new class that inherits from ArrayAdapter private class CustomAdapter extends ArrayAdapter<Transaction>{ public ProfileAdapter( ArrayList<Transaction> transactions ){ super(getapplicationcontext(), 0, transactions); }

40 ArrayAdapter Extended private class CustomAdapter extends ArrayAdapter<Transaction>{ public CustomAdapter(Context context, Transaction[] transactions){ super(context, public View getview(int position, View convertview, ViewGroup parent){ Transaction transaction = getitem(position); if(convertview == null){ convertview = LayoutInflater.from( getcontext()).inflate( R.layout.layout_listview_custom, null, false);} TextView text=(textview)convertview.findviewbyid(r.id.textview); text.settext(transaction.tostring()); return convertview; }}

41 ArrayAdapter Extended You should now have the following:

42 Pictures with Intents Since this app will require a camera to function, we need to add the <uses-feature> tag in the manifest: <uses-feature android:name="android.hardware.camera android:required="true"/> If the camera is not required, but still potential used in a feature set required to false and check at runtime with: if(getpackagemanager(). hassystemfeature( PackageManager.FEATURE_CAMERA))

43 Pictures with Intents An implicit intent can be used to call a camera application and receive picture data from it Create a layout with an image view and a button We will populate the ImageView with the camera data we receive We need to first check if the system can support the image capture:

44 Pictures with Intents Create an intent that requests for an action for image capture Resolve whether or not we have an app that can handle it If yes, start the activity and pass in an Integer identifier Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if(i.resolveactivity( getpackagemanager())!= null) { startactivityforresult(i, REQUEST_IMAGE_CAPTURE); }

45 Pictures with Intents Intents can transfer around 500kB of data before crashing your application Photos from most cameras are too large to transfer through Intents If all you want is a small thumbnail, it can be returned by the intent in onactivityresult() under the key protected void onactivityresult(int requestcode, int resultcode,intent data) { super.onactivityresult(requestcode, resultcode, data); } if(requestcode == REQUEST_IMAGE_CAPTURE && resultcode == RESULT_OK) { Bundle extras = data.getextras(); Bitmap imagebitmap = (Bitmap) extras.get("data"); imageview.setimagebitmap(imagebitmap); }

46 Full Size Pictures with Intents The camera application can save a full-size photo if it has a file to save into (fully qualified name to place the photo) Typically, this is public external storage accessible by all apps: getexternalstoragepublicdirectory(directory_pictures) We require the manifest permission WRITE_EXTERNAL_STORAGE, which gives us both write and read access <uses-feature android:name="android.hardware.camera android:required="true"/> <uses-permission android:name= "android.permission.write_external_storage"/>

47 Full Size Pictures with Intents The filename we decide to use needs to be unique (free of naming collisions) We can do this with either the time stamp String string = new SimpleDateFormat( "yyyymmdd_hhmmss"). format(new Date()); We can also do this with a UUID (universally unique identifier) UUID uniqueid = UUID.randomUUID();

48 Full Size Pictures with Intents private File createimagefile() throws IOException { File image; String filename = "JPEG_" + UUID.randomUUID().toString() + "_"; String extension = ".jpg"; File dir = getexternalfilesdir( Environment.DIRECTORY_PICTURES); image = File.createTempFile(fileName, extension, dir); photopath = image.getabsolutepath(); } return image;

49 Full Size Pictures with Intents private void takepicture() { Intent pi = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if(pi.resolveactivity(getpackagemanager())!= null) { File photofile = null; try{ photofile = createimagefile(); } catch(ioexception io) {} if(photofile!= null) { Uri uri = FileProvider.getUriForFile(this, "com.georgelecakes.android.fileprovider", photofile); pi.putextra(mediastore.extra_output, uri); startactivityforresult(pi, REQUEST_IMAGE_CAPTURE); } } }

INTRODUCTION COS MOBILE DEVELOPMENT WHAT IS ANDROID CORE OS. 6-Android Basics.key - February 21, Linux-based.

INTRODUCTION COS MOBILE DEVELOPMENT WHAT IS ANDROID CORE OS. 6-Android Basics.key - February 21, Linux-based. 1 COS 470 - MOBILE DEVELOPMENT INTRODUCTION 2 WHAT IS ANDROID Linux-based Java/Kotlin Android Runtime (ART) System Apps SMS, Calendar, etc. Platform Architecture 3 CORE OS Linux (64 bit) Each app is a

More information

Programming with Android: Activities and Intents. Dipartimento di Informatica Scienza e Ingegneria Università di Bologna

Programming with Android: Activities and Intents. Dipartimento di Informatica Scienza e Ingegneria Università di Bologna Programming with Android: Activities and Intents Luca Bedogni Marco Di Felice Dipartimento di Informatica Scienza e Ingegneria Università di Bologna Outline What is an intent? Intent description Handling

More information

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie The image cannot be displayed. Your computer

More information

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015 Developing Android Applications Introduction to Software Engineering Fall 2015 Updated 1st November 2015 Android Lab 3 & Midterm Additional Concepts No Class Assignment 2 Class Plan Android : Additional

More information

Workshop. 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking

Workshop. 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking Workshop 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking 2. Create Intent with Parsing Data (Page 3 8) Making Phone Call and Dial Access Web Content Playing YouTube Video 3. Create

More information

Programming with Android: Intents. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna

Programming with Android: Intents. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna Programming with Android: Intents Luca Bedogni Dipartimento di Scienze dell Informazione Università di Bologna Outline What is an intent? Intent description Handling Explicit Intents Handling implicit

More information

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen Gill Cleeren Agenda Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen Lists and navigation Navigating from master to detail Optimizing the application Preparing

More information

ListView Containers. Resources. Creating a ListView

ListView Containers. Resources. Creating a ListView ListView Containers Resources https://developer.android.com/guide/topics/ui/layout/listview.html https://developer.android.com/reference/android/widget/listview.html Creating a ListView A ListView is a

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 2 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 1 -recap What is Android How to develop Android applications Run & debug the applications

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

Software Practice 3 Today s lecture Today s Task Porting Android App. in real device

Software Practice 3 Today s lecture Today s Task Porting Android App. in real device 1 Software Practice 3 Today s lecture Today s Task Porting Android App. in real device Prof. Hwansoo Han T.A. Jeonghwan Park 43 INTENT 2 3 Android Intent An abstract description of a message Request actions

More information

Intents. 18 December 2018 Lecture Dec 2018 SE 435: Development in the Android Environment 1

Intents. 18 December 2018 Lecture Dec 2018 SE 435: Development in the Android Environment 1 Intents 18 December 2018 Lecture 4 18 Dec 2018 SE 435: Development in the Android Environment 1 Topics for Today Building an Intent Explicit Implicit Other features: Data Result Sources: developer.android.com

More information

ListView (link) An ordered collection of selectable choices. key attributes in XML:

ListView (link) An ordered collection of selectable choices. key attributes in XML: CS 193A Lists This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. ListView (link) An ordered collection

More information

Creating a Custom ListView

Creating a Custom ListView Creating a Custom ListView References https://developer.android.com/guide/topics/ui/declaring-layout.html#adapterviews Overview The ListView in the previous tutorial creates a TextView object for each

More information

Using Intents to Launch Activities

Using Intents to Launch Activities Using Intents to Launch Activities The most common use of Intents is to bind your application components. Intents are used to start, stop, and transition between the Activities within an application. The

More information

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics Chapter 10 Speech Recognition 10.1 Introduction Speech recognition (SR) by machine, which translates spoken words into text has been a goal of research for more than six decades. It is also known as automatic

More information

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah. Islamic University of Gaza Faculty of Engineering Computer Engineering Department Mobile Computing ECOM 5341 By Eng. Wafaa Audah July 2013 1 Launch activitits, implicit intents, data passing & start activity

More information

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie User Interface Design" & Development -

More information

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

Developing Android Applications

Developing Android Applications Developing Android Applications SEG2105 - Introduction to Software Engineering Fall 2016 Presented by: Felipe M. Modesto TA & PhD Candidate Faculty of Engineering Faculté de Génie uottawa.ca Additional

More information

Developing Android Applications

Developing Android Applications Developing Android Applications Introduction to Software Engineering Fall 2015 Updated 21 October 2015 Android Lab 02 Advanced Android Features 2 Class Plan UI Elements Activities Intents Data Transfer

More information

Introduction to Android Multimedia

Introduction to Android Multimedia Introduction to Android Multimedia CS 436 Software Development on Mobile By Dr.Paween Khoenkaw Android Intent Intent,Intent-filter What is Intent? -Intent is a message sent from one program to another

More information

Introductory Mobile App Development

Introductory Mobile App Development Introductory Mobile App Development 152-160 Quick Links & Text References Overview Pages ListView Pages ArrayAdaper Pages Filling a ListView Pages Sensing Click Pages Selected Item Info Pages Configuring

More information

The Intent Class Starting Activities with Intents. Explicit Activation Implicit Activation via Intent resolution

The Intent Class Starting Activities with Intents. Explicit Activation Implicit Activation via Intent resolution The Intent Class Starting Activities with Intents Explicit Activation Implicit Activation via Intent resolution A data structure that represents An operation to be performed, or An event that has occurred

More information

Building User Interface for Android Mobile Applications II

Building User Interface for Android Mobile Applications II Building User Interface for Android Mobile Applications II Mobile App Development 1 MVC 2 MVC 1 MVC 2 MVC Android redraw View invalidate Controller tap, key pressed update Model MVC MVC in Android View

More information

Activities and Fragments

Activities and Fragments Activities and Fragments 21 November 2017 Lecture 5 21 Nov 2017 SE 435: Development in the Android Environment 1 Topics for Today Activities UI Design and handlers Fragments Source: developer.android.com

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

Android Programming Lecture 7 9/23/2011

Android Programming Lecture 7 9/23/2011 Android Programming Lecture 7 9/23/2011 Multiple Activities So far, projects limited to one Activity Next step: Intra-application communication Having multiple activities within own application Inter-application

More information

Android Help. Section 8. Eric Xiao

Android Help. Section 8. Eric Xiao Android Help Section 8 Eric Xiao The Midterm That happened Any residual questions? New Assignment! Make a low-fi prototype Must be interactive Use balsamiq or paper Test it with users 3 tasks Test task

More information

Android. Operating System and Architecture. Android. Screens. Main features

Android. Operating System and Architecture. Android. Screens. Main features Android Android Operating System and Architecture Operating System and development system from Google and Open Handset Alliance since 2008 At the lower level is based on the Linux kernel and in a higher

More information

CS 370 Android Basics D R. M I C H A E L J. R E A L E F A L L

CS 370 Android Basics D R. M I C H A E L J. R E A L E F A L L CS 370 Android Basics D R. M I C H A E L J. R E A L E F A L L 2 0 1 5 Activity Basics Manifest File AndroidManifest.xml Central configuration of Android application Defines: Name of application Icon for

More information

GUI Widget. Lecture6

GUI Widget. Lecture6 GUI Widget Lecture6 AnalogClock/Digital Clock Button CheckBox DatePicker EditText Gallery ImageView/Button MapView ProgressBar RadioButton Spinner TextView TimePicker WebView Android Widgets Designing

More information

Mobile Programming Lecture 3. Resources, Selection, Activities, Intents

Mobile Programming Lecture 3. Resources, Selection, Activities, Intents Mobile Programming Lecture 3 Resources, Selection, Activities, Intents Lecture 2 Review What widget would you use to allow the user to enter a yes/no value a range of values from 1 to 100 What's the benefit

More information

Adapter.

Adapter. 1 Adapter An Adapter object acts as a bridge between an AdapterView and the underlying data for that view The Adapter provides access to the data items The Adapter is also responsible for making a View

More information

Minds-on: Android. Session 2

Minds-on: Android. Session 2 Minds-on: Android Session 2 Paulo Baltarejo Sousa Instituto Superior de Engenharia do Porto 2016 Outline Activities UI Events Intents Practice Assignment 1 / 33 2 / 33 Activities Activity An activity provides

More information

ANDROID APPS DEVELOPMENT FOR MOBILE GAME

ANDROID APPS DEVELOPMENT FOR MOBILE GAME ANDROID APPS DEVELOPMENT FOR MOBILE GAME Application Components Hold the content of a message (E.g. convey a request for an activity to present an image) Lecture 2: Android Layout and Permission Present

More information

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University. Overview (Review)

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University. Overview (Review) EECS 4443 Mobile User Interfaces More About Layouts Scott MacKenzie York University Overview (Review) A layout defines the visual structure for a user interface, such as the UI for an activity or app widget

More information

Android User Interface

Android User Interface Android Smartphone Programming Matthias Keil Institute for Computer Science Faculty of Engineering 20. Oktober 2014 Outline 1 Android User Interface 2 Multi-Language Support 3 Summary Matthias Keil Android

More information

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu Fragments Recall: Fragments Sub-components of an Activity (screen) An activity can contain multiple fragments, organized

More information

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie The image cannot be displayed. Your computer

More information

When programming in groups of people, it s essential to version the code. One of the most popular versioning tools is git. Some benefits of git are:

When programming in groups of people, it s essential to version the code. One of the most popular versioning tools is git. Some benefits of git are: ETSN05, Fall 2017, Version 1.0 Software Development of Large Systems Lab 2 preparations Read through this document carefully. In order to pass lab 2, you will need to understand the topics presented in

More information

CMSC436: Fall 2013 Week 3 Lab

CMSC436: Fall 2013 Week 3 Lab CMSC436: Fall 2013 Week 3 Lab Objectives: Familiarize yourself with the Activity class, the Activity lifecycle, and the Android reconfiguration process. Create and monitor a simple application to observe

More information

Mobile User Interfaces

Mobile User Interfaces Mobile User Interfaces CS 2046 Mobile Application Development Fall 2010 Announcements Next class = Lab session: Upson B7 Office Hours (starting 10/25): Me: MW 1:15-2:15 PM, Upson 360 Jae (TA): F 11:00

More information

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University EECS 4443 Mobile User Interfaces More About Layouts Scott MacKenzie York University Overview (Review) A layout defines the visual structure for a user interface, such as the UI for an activity or app widget

More information

Android: Intents, Menus, Reflection, and ListViews

Android: Intents, Menus, Reflection, and ListViews ,,, and,,, and Harvard University March 1, 2011 Announcements,,, and Lecture videos available at: https://www.cs76.net/lectures Section schedule: https://www.cs76.net/sections n-puzzle walkthrough: https://www.cs76.net/sections

More information

Android User Interface Android Smartphone Programming. Outline University of Freiburg

Android User Interface Android Smartphone Programming. Outline University of Freiburg Android Smartphone Programming Matthias Keil Institute for Computer Science Faculty of Engineering 20. Oktober 2014 Outline 1 2 Multi-Language Support 3 Summary Matthias Keil 20. Oktober 2014 2 / 19 From

More information

Terms: MediaPlayer, VideoView, MediaController,

Terms: MediaPlayer, VideoView, MediaController, Terms: MediaPlayer, VideoView, MediaController, Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: www.sisoft.in Email:info@sisoft.in Phone: +91-9999-283-283

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 Programming Lecture 2 9/7/2011

Android Programming Lecture 2 9/7/2011 Android Programming Lecture 2 9/7/2011 Creating a first app 1. Create a new Android project (a collection of source code and resources for the app) from the Eclipse file menu 2. Choose a project name (can

More information

Homework 3 - Dumb Notes

Homework 3 - Dumb Notes Homework 3 - Dumb Notes Due Date: 2/14/19 by 11:59pm For this homework you will use Fragments, Intent filters, and a custom ArrayAdapter to build a simple note-taking app. The app provides functionality

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

Android File & Storage

Android File & Storage Files Lecture 9 Android File & Storage Android can read/write files from two locations: Internal (built into the device) and external (an SD card or other drive attached to device) storage Both are persistent

More information

Android Programming in Bluetooth Cochlea Group

Android Programming in Bluetooth Cochlea Group Android Programming in Bluetooth Cochlea Group Zijian Zhao Abstract: My project is mainly android programming work in the Bluetooth Cochlea Group. In this report I will first introduce the background of

More information

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs Overview MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs Lecture: MVC Model View Controller What is an App? Android Activity Lifecycle Android Debugging Fixing Rotations & Landscape Layouts Localization

More information

Writing Efficient Drive Apps for Android. Claudio Cherubino / Alain Vongsouvanh Google Drive Developer Relations

Writing Efficient Drive Apps for Android. Claudio Cherubino / Alain Vongsouvanh Google Drive Developer Relations Writing Efficient Drive Apps for Android Claudio Cherubino / Alain Vongsouvanh Google Drive Developer Relations Raise your hand if you use Google Drive source: "put your hands up!" (CC-BY) Raise the other

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

TextView. A label is called a TextView. TextViews are typically used to display a caption TextViews are not editable, therefore they take no input

TextView. A label is called a TextView. TextViews are typically used to display a caption TextViews are not editable, therefore they take no input 1 UI Components 2 UI Components 3 A label is called a TextView. TextView TextViews are typically used to display a caption TextViews are not editable, therefore they take no input - - - - - - -

More information

Mobile Programming Lecture 9. Bound Services, Location, Sensors, IntentFilter

Mobile Programming Lecture 9. Bound Services, Location, Sensors, IntentFilter Mobile Programming Lecture 9 Bound Services, Location, Sensors, IntentFilter Agenda Bound Services Location Sensors Starting an Activity for a Result Understanding Implicit Intents Bound Service When you

More information

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2. Outline 1. Set up Android Studio Android development Tiberiu Vilcu Prepared for EECS 411 Sugih Jamin 15 September 2017 2. Create sample app 3. Add UI to see how the design interface works 4. Add some code

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

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

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

BCS3283-Mobile Application Development

BCS3283-Mobile Application Development For updated version, please click on http://ocw.ump.edu.my BCS3283-Mobile Application Development Chapter 7 Intent Editor Dr. Mohammed Falah Mohammed Faculty of Computer Systems & Software Engineering

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu India Summer 2012 Review Session Android and Web Working with Views Working with Views Create a new Android project. The app name should

More information

Mobile and Ubiquitous Computing: Android Programming (part 3)

Mobile and Ubiquitous Computing: Android Programming (part 3) Mobile and Ubiquitous Computing: Android Programming (part 3) Master studies, Winter 2015/2016 Dr Veljko Pejović Veljko.Pejovic@fri.uni-lj.si Based on Programming Handheld Systems, Adam Porter, University

More information

Required Core Java for Android application development

Required Core Java for Android application development Required Core Java for Android application development Introduction to Java Datatypes primitive data types non-primitive data types Variable declaration Operators Control flow statements Arrays and Enhanced

More information

Graphical User Interfaces

Graphical User Interfaces Graphical User Interfaces Some suggestions Avoid displaying too many things Well-known anti-patterns Display useful content on your start screen Use action bars to provide consistent navigation Keep your

More information

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2 M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2 1) What is Intent? How it is useful for transitioning between various activities? How intents can be received & broadcasted. (Unit :-2, Chapter

More information

CS371m - Mobile Computing. User Interface Basics

CS371m - Mobile Computing. User Interface Basics CS371m - Mobile Computing User Interface Basics Clicker Question Have you ever implemented a Graphical User Interface (GUI) as part of a program? A. Yes, in another class. B. Yes, at a job or internship.

More information

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters Mobile Programming Lecture 5 Composite Views, Activities, Intents and Filters Lecture 4 Review How do you get the value of a string in the strings.xml file? What are the steps to populate a Spinner or

More information

getcount getitem getitemid getview com.taxi Class MainActivity drawerlayout drawerleft drawerright...

getcount getitem getitemid getview com.taxi Class MainActivity drawerlayout drawerleft drawerright... Contents com.taxi.ui Class CallDialog... 3 CallDialog... 4 show... 4 build... 5 com.taxi.custom Class CustomActivity... 5 TOUCH... 6 CustomActivity... 6 onoptionsitemselected... 6 onclick... 6 com.taxi.model

More information

Mobile Development Lecture 8: Intents and Animation

Mobile Development Lecture 8: Intents and Animation Mobile Development Lecture 8: Intents and Animation Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com 1. Multiple Activities Intents Multiple Activities Many apps have multiple activities.

More information

Practical 1.ListView example

Practical 1.ListView example Practical 1.ListView example In this example, we show you how to display a list of fruit name via ListView. Android Layout file File : res/layout/list_fruit.xml

More information

Chapter 7: Reveal! Displaying Pictures in a Gallery

Chapter 7: Reveal! Displaying Pictures in a Gallery Chapter 7: Reveal! Displaying Pictures in a Gallery Objectives In this chapter, you learn to: Create an Android project using a Gallery control Add a Gallery to display a horizontal list of images Reference

More information

CS 193A. Multiple Activities and Intents

CS 193A. Multiple Activities and Intents CS 193A Multiple Activities and Intents This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. Multiple

More information

Using Libraries, Text-to-Speech, Camera. Lecture 12

Using Libraries, Text-to-Speech, Camera. Lecture 12 Using Libraries, Text-to-Speech, Camera Lecture 12 Libraries Many Android developers have produced useful libraries. There is a Maven repository to store various libraries This makes it easy to add them

More information

package import import import import import import import public class extends public void super new this class extends public super public void new

package import import import import import import import public class extends public void super new this class extends public super public void new Android 2-D Drawing Android uses a Canvas object to host its 2-D drawing methods. The program below draws a blue circle on a white canvas. It does not make use of the main.xml layout but draws directly

More information

ANDROID SYLLABUS. Advanced Android

ANDROID SYLLABUS. Advanced Android Advanced Android 1) Introduction To Mobile Apps I. Why we Need Mobile Apps II. Different Kinds of Mobile Apps III. Briefly about Android 2) Introduction Android I. History Behind Android Development II.

More information

Programmation Mobile Android Master CCI

Programmation Mobile Android Master CCI Programmation Mobile Android Master CCI Bertrand Estellon Aix-Marseille Université March 23, 2015 Bertrand Estellon (AMU) Android Master CCI March 23, 2015 1 / 266 Navigation entre applications Nous allons

More information

Starting Another Activity Preferences

Starting Another Activity Preferences Starting Another Activity Preferences Android Application Development Training Xorsat Pvt. Ltd www.xorsat.net fb.com/xorsat.education Outline Starting Another Activity Respond to the Button Create the

More information

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling Mobile Programming Lecture 2 Layouts, Widgets, Toasts, and Event Handling Lecture 1 Review How to edit XML files in Android Studio? What holds all elements (Views) that appear to the user in an Activity?

More information

EMBEDDED SYSTEMS PROGRAMMING Application Basics

EMBEDDED SYSTEMS PROGRAMMING Application Basics EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Basics APPLICATIONS Application components (e.g., UI elements) are objects instantiated from the platform s frameworks Applications are event driven ( there

More information

The Intent Class Starting Activities with Intents. Explicit Activation Implicit Activation via Intent resolution

The Intent Class Starting Activities with Intents. Explicit Activation Implicit Activation via Intent resolution The Intent Class Starting Activities with Intents Explicit Activation Implicit Activation via Intent resolution a data structure that represents An operation to be performed, or An event that has occurred

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

DROIDS ON FIRE. Adrián

DROIDS ON FIRE. Adrián DROIDS ON FIRE Adrián Catalán @ykro https://goo.gl/ ige2vk Developer experience matters Cross-platform Integrated Getting Started with Firebase http://github.com /ykro/wikitaco App.java @Override

More information

ActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { }

ActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { } Android ActionBar import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { Layout, activity.xml

More information

User Interface Design & Development

User Interface Design & Development User Interface Design & Development Lecture Intro to Android João Pedro Sousa SWE 632, Fall 2011 George Mason University features multitasking w/ just-in-time compiler for Dalvik-VM bytecode storage on

More information

The Suggest Example layout (cont ed)

The Suggest Example layout (cont ed) Using Web Services 5COSC005W MOBILE APPLICATION DEVELOPMENT Lecture 7: Working with Web Services Android provides a full set of Java-standard networking APIs, such as the java.net package containing among

More information

Mobile Computing Practice # 2a Android Applications - Interface

Mobile Computing Practice # 2a Android Applications - Interface Mobile Computing Practice # 2a Android Applications - Interface 1. Create an Android Lunch Places List application that allows the user to take note of restaurant characteristics like its name, address

More information

Hello World. Lesson 1. Android Developer Fundamentals. Android Developer Fundamentals. Layouts, and. NonCommercial

Hello World. Lesson 1. Android Developer Fundamentals. Android Developer Fundamentals. Layouts, and. NonCommercial Hello World Lesson 1 This work is licensed This under work a Creative is is licensed Commons under a a Attribution-NonCommercial Creative 4.0 Commons International Attribution- License 1 NonCommercial

More information

Introduction to Android Development

Introduction to Android Development Introduction to Android Development What is Android? Android is the customizable, easy to use operating system that powers more than a billion devices across the globe - from phones and tablets to watches,

More information

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu Announcements Group formation: Projects 2, 3 and final project will be

More information

Android for Ubiquitous Computing Researchers. Andrew Rice University of Cambridge 17-Sep-2011

Android for Ubiquitous Computing Researchers. Andrew Rice University of Cambridge 17-Sep-2011 Android for Ubiquitous Computing Researchers Andrew Rice University of Cambridge 17-Sep-2011 Getting started Website for the tutorial: http://www.cl.cam.ac.uk/~acr31/ubicomp/ Contains links to downloads

More information

stolen from Intents and Intent Filters

stolen from  Intents and Intent Filters stolen from http://developer.android.com/guide/components/intents-filters.html Intents and Intent Filters Three of the core components of an application activities, services, and broadcast receivers are

More information

Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial

Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial Revision history 90001431-13 Revision Date Description A October 2014 Original release. B October 2017 Rebranded the document. Edited the document.

More information

Android Application Development 101. Jason Chen Google I/O 2008

Android Application Development 101. Jason Chen Google I/O 2008 Android Application Development 101 Jason Chen Google I/O 2008 Goal Get you an idea of how to start developing Android applications Introduce major Android application concepts Provide pointers for where

More information

By The Name of Allah. The Islamic University of Gaza Faculty of Engineering Computer Department Final Exam. Mobile Computing

By The Name of Allah. The Islamic University of Gaza Faculty of Engineering Computer Department Final Exam. Mobile Computing By The Name of Allah The Islamic University of Gaza Faculty of Engineering Computer Department Final Exam Dr. Aiman Ahmed Abu Samra Eng. Nour El-Deen I. Jaber Student Name ID Mark Exam Duration \ 1:30

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 - recap Views and Layouts Events Basic application components Activities Intents 9/15/2014

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

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