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

Size: px
Start display at page:

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

Transcription

1 Islamic University of Gaza Faculty of Engineering Computer Engineering Department Mobile Computing ECOM 5341 By Eng. Wafaa Audah July

2 Launch activitits, implicit intents, data passing & start activity for result Intents An Android application could include any number of activities. Activities are independent of each other; however they usually cooperate exchanging data and actions. Moving from one activity to another is accomplished by asking the current activity to execute an intent. Intents are used to start new activities, either explicitly or implicitly. Intents are used as a message-passing mechanism within and between applications. Intents are used for broadcasting messages across the system. Intents Types There are two primary forms of intents you will use. - Explicit Intents: provides the exact class to be run. Often these will not include any other information, simply being a way for an application to launch various internal activities it has as the user interacts with the application. - Implicit Intents: they must include enough information for the system to determine which of the available components is best to run for that intent. Android provides some implicit actions that can be caught and handled by OS. The main arguments of implicit Intent are: - Action: The built-in action to be performed, such as ACTION_VIEW, ACTION_MAIN, etc. - Data: The primary data to operate on, such as a phone number to be called (expressed as tel:, smsto:) 2

3 Launch activity: Intent myactivity = new Intent (action, data); startactivity (myactivity); Examples of native action/data pairs are: ACTION_DIAL tel: Display the phone dialer with the given number filled in. ACTION_CALL tel: Brings up a phone dialer and immediately initiates a call using the number supplied in the Intent URI. ACTION_VIEW - ACTION_VIEW Show Google page in a browser view. - ACTION_VIEW content://contacts/ people/ Display a list of people, which the user can browse through. Selecting a particular person to view would result in a new intent. ACTION_EDIT content://contacts/people/2 Edit information about the contact person whose identifier is "2". ACTION_PICK Launches a sub-activity that lets you pick an item from the Content Provider specified by the Intent URI. When closed it should return a URI to the item that was picked. ACTION_SENDTO smsto: Launches an Activity to send a message to the contact specified by the Intent URI. Implicit Intents Examples Intent i = new Intent(Intent.ACTION_DIAL,Uri.parse("tel: ")); startactivity(i); Intent i = new Intent(Intent.ACTION_VIEW,Uri.parse(" startactivity(i); 3

4 Lab Work 1 Create an interface as the figure below shows. When the user enter phone number and click Call button, It calls the number in the EditText. (This will need permission; permissions are clarified at the next page) 4

5 Permission Permission is a restriction limiting access to a part of the code or to data on the device. The limitation is imposed to protect critical data and code that could be misused to distort or damage the user experience. For example, here are some of the permissions defined by Android: android.permission.call_emergency_numbers android.permission.call_phone android.permission.read_owner_data android.permission.set_wallpaper android.permission.device_power android.permission.internet How to make it 5

6 <uses-permission> Requests a permission that the application must be granted in order for it to operate correctly. Permissions are granted by the user when the application is installed, not while it's running. <permission> Declares a security permission that can be used to limit access to specific components or features of this or other applications. 6

7 Intents used to: Launch an Activity (explicitly) Intent i = new Intent (CurrentActivity.this, DestinationActivity.class); startactivity(i); (All activities must be added to the AndroidManifest.xml File) - Data-passing mechanism between activities (explicitly) To share primitive data between Activities/Services in an application, use Intent.putExtra (key,value), getextra(key) is used to extract data from the intent. First Activity Intent i = new Intent(First.this,Second.class); i.putextra("msg", "hi"); startactivity(i); Second Activity Intent i = this.getintent(); String x = i.getstringextra("msg"); putexrta can take String, Integer, Double, Boolean, IntArray and other types. Extra.. Using Bundle - The Android Bundle container is a simple mechanism used to pass data between co-operating activities. It is a type-safe MAP collection of <key, value> pairs. - There is a set of putxxx and getxxx methods to store and retrieve (single and array) values of primitive data types from/to the bundles. 7

8 - The code using an additional bundle is slightly heavier(it won't make any difference in any practical application) and slightly easier to manage, being more general(if you decide that - before sending information inside an intent - you want to serialize the data to database - it will be a bit cleaner to have a bundle that you can serialize, add to intent and then feed to a Bundle all in one object) Example First Activity Second Activity Intent i= new Intent(First.this, Second.class); Bundle extras = new Bundle(); extras.putstring("username","name"); extras.putint("password","pass"); int[] code={1,2,3}; extras.putintarray("code",code); extras.putboolean("check",true); intent.putextras(extras); startactivity(intent); Bundle extras = getintent().getextras(); String name = extras.getstring("username "); int password = extras.getint("password"); int [] code = extras.getintarray("code"); boolean check = extras.getboolean("check"); Note: In order to get the array at a correct shape : String array2str=" " for (int m=0; m<code.length; m++) { array2str = array2str + "," + Integer.toString( code[m] ); } 8

9 Lab Work 2 Create an interface as the figure below shows. - User fills the two fields and checks the checkbox, then click Save in the first activity: - The second activity must get the entered data in first activity and its interface appears by this way: Your Name is (from first activity) Your ID is ((from first activity)) Accept rules checkbox status is (from first activity) (Using textview/s) Hint: At first: i.putextra("id", ); At second: int y i.putextra("accept", true); = i.getintextra("id",-1); << -1 : default value if null is returned >> boolean z = i.getbooleanextra("accept",false); << false : Default value >> 9

10 Starting an Activity for a result - In order to get results back from the called activity we use the method startactivityforresult ( Intent, requestcodeid ) - Where requestcodeid is an arbitrary value you choose to identify the call. (similar to a nickname ). - The result sent by the sub-activity could be picked up through the listener-like asynchronous method onactivityresult ( requestcodeid, resultcode, Intent ) - Before an invoked activity exits, it can call setresult(resultcode) to return a termination signal back to its parent. FirstActivity final public static int SECOND_ACTIVITY_ID= 2; Intent i= new Intent (FirstActivity.this, SecondActivity.class) startactivityforresult(i, protected void onactivityresult(int requestcode, int resultcode, Intent data) { // TODO Auto-generated method stub super.onactivityresult(requestcode, resultcode, data); switch (requestcode) { case SECOND_ACTIVITY_ID: if(resultcode==activity.result_ok){ String name = data.getstringextra("username"); break; }else if (resultcode==activity.result_canceled){ //Do Something } // if there are more one activity that we want to startactivityforresult // for it, many cases will be added here 10 with different activity numbers give above }

11 SecondActivity Intent i = new Intent(); data.putextra("username","myname"); setresult(result_ok, i); finish(); Lab Work 3 Go back to lab work 2, add button and textview/s as the figure below shows. When user click More the following interface will appear, user fill the fields, clicks Save, entered data will be returned back to the main interface at the textview 11

12 Homework Create an activity << FirstOne >>interface that contains 2buttons <<Review>> & << Let s Go >> and textview/s for << Result >> Create another three activities (classes) at the same application - 1 st : MainTabActivity - 2 nd : MessageTab : its interface contains: 1. edittext to enter phone number that you will send msg for it, 2. button << view >> - 3 rd : WebTab : its interface contains: 1. edittext to enter the website link that you will want to view, 2. button < finish >> 3. button << view >> - Two activities (MessageTab and WebTab) will be Tabbed. (Every tab represents activity, MainTabActivity will be the main container activity that contain the tabhost) Scenario will be as the following: FirstOne interface appear. When user clicks Let s Go: 1. MainTabActivity will be started for result, it will show MessageTab, WebTab in tabs, user will work with both of activities.(send msg, view web :on view button click) 2. MainTabActivity will return the entered data from them *** (on finish button click), and it will return these result to FirstOne. 3. Result will appear at FirstOne on textviews. When user clicks Review, interface at labwork2 will appear, entered data will be returned at the textview at FirstOne: *** Msg sent successfully to: (from returned result 1) The following website opened successfully: (from returned result 1) Your Name is: (from returned result 2) Your ID is: (from returned result 2) Accept rules checkbox status is: 12 (from returned result 2)

13 Tabs Sometimes, we want to wrap multiple views in a single window and navigate through them with a Tab Container. This can be done in Android using TabHost control. There are two ways to use a TabHost application in Android: 1. Using the TabHost to navigate through multiple views within the same activity. 2. Using the TabHost to navigate through Actual multiple Activities using intents (wanted!) Anatomy of Tabbed Application An activity with a TabHost may look like this: The Activity consists of: 1. A TabHost: The root element of the layout 2. The TabHost wraps a TabWidget which represents the tab bar. 3. The TabHost wraps a FrameLayout which wraps the contents of each tab. 13

14 - What if we have multiple Activities in our application and we want to navigate between them using tabs; In this case, we will have one activity as the root activity of the application. - This activity will have the TabHost and will navigate to other activities using Intents. Note: The root activity must inherit from TabActivity. The root activity will have layout file like this: <?xml version="1.0" encoding="utf-8"?> <TabHost android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@android:id/tabhost" xmlns:android=" > <TabWidget android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@android:id/tabs" /> <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@android:id/tabcontent" > </FrameLayout> </TabHost> 14

15 In order to view two tabs, the foloowing code is used import android.os.bundle; import android.app.activity; import android.app.tabactivity; import android.content.intent; import android.widget.tabhost; public class TaActivity extends TabActivity protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_tab); TabHost tabhost=gettabhost(); TabHost.TabSpec spec; Intent i1=new Intent(TaActivity.this,one.class); spec=tabhost.newtabspec("tab1").setindicator("tab1").setcontent(i1); tabhost.addtab(spec); Intent i2=new Intent(TaActivity.this,two.class); spec=tabhost.newtabspec("tab2").setindicator("tab2").setcontent(i2); tabhost.addtab(spec); tabhost.setcurrenttab(0); }} 1. We create tabs using TabSpecs class. 2. We set the title of each tab using TabSpecs.setIndicator() method. 3. We set the content of each tab using TabSpecs.setContent() method. 15

16 Important note. At your homework: 1. MainTabActivity interface will be typically like the xml file above. 2. Code will be written within MainTabActivity. 3. Tabs will have interfaces as specified before. 4. Change application theme into Theme.Black.NoTitleBar. 5. You can choose an icon photo for every tab (optional). In order to see an example of how to set the contents of tabs by specifying multiple layout resources to be displayed within the same activity, visit the following link (optional) SEE YOU AT THE NEXT LAB 16

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

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

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

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

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

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

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

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

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

INTENTS android.content.intent

INTENTS android.content.intent INTENTS INTENTS Intents are asynchronous messages which allow application components to request functionality from other Android components. Intents allow you to interact with components from the same

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

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

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

Android Intents. Notes are based on: Android Developers

Android Intents. Notes are based on: Android Developers Android Notes are based on: Android Developers http://developer.android.com/index.html 12. Android Android Activities An Android application could include any number of activities. An activity uses the

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

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

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento Let s work with the listener Button button = ; button.setonclicklistener(new.onclicklistener() { public void

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

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

Understanding Application

Understanding Application Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 4 Understanding Application Components Chapter 4 Overview Master important terminology Learn what the application

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

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

Mobile Computing Practice # 2c Android Applications - Interface

Mobile Computing Practice # 2c Android Applications - Interface Mobile Computing Practice # 2c Android Applications - Interface One more step in the restaurants application. 1. Design an alternative layout for showing up in landscape mode. Our current layout is not

More information

Android HelloWorld - Example. Tushar B. Kute,

Android HelloWorld - Example. Tushar B. Kute, Android HelloWorld - Example Tushar B. Kute, http://tusharkute.com Anatomy of Android Application Anatomy of Android Application Java This contains the.java source files for your project. By default, it

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

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

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Tip: Switching UIs THE PROBLEM How to switch from one UI to another Each UI is associated with a distinct class that controls it Solution shown: two UIs,

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

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

<uses-permission android:name="android.permission.internet"/>

<uses-permission android:name=android.permission.internet/> Chapter 11 Playing Video 11.1 Introduction We have discussed how to play audio in Chapter 9 using the class MediaPlayer. This class can also play video clips. In fact, the Android multimedia framework

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 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

Learn about Android Content Providers and SQLite

Learn about Android Content Providers and SQLite Tampa Bay Android Developers Group Learn about Android Content Providers and SQLite Scott A. Thisse March 20, 2012 Learn about Android Content Providers and SQLite What are they? How are they defined?

More information

Why using intents. Activity. Screen1 Screen 2

Why using intents. Activity. Screen1 Screen 2 INTENTS Why using intents Screen1 Screen 2 Activity An activity may manage many layout file (screens) Intents, provides a way for an activity to start another activity (thus changing screen) Beside this

More information

else if(rb2.ischecked()) {

else if(rb2.ischecked()) { Problem :Toy Calculator Description:Please design an Android application that contains 2 activities: cal_main and cal_result. The following figure is a suggested layout for the cal_main activity. For the

More information

ANDROID PROGRAMS DAY 3

ANDROID PROGRAMS DAY 3 ANDROID PROGRAMS DAY 3 //Android project to navigate from first page to second page using Intent Step 1: Create a new project Step 2: Enter necessary details while creating project. Step 3: Drag and drop

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

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

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

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

Overview. Lecture: Implicit Calling via Share Implicit Receiving via Share Launch Telephone Launch Settings Homework Implicit Intents Overview Lecture: Implicit Calling via Share Implicit Receiving via Share Launch Telephone Launch Settings Homework Intents Intent asynchronous message used to activate one Android component

More information

Basic GUI elements - exercises

Basic GUI elements - exercises Basic GUI elements - exercises https://developer.android.com/studio/index.html LIVE DEMO Please create a simple application, which will be used to calculate the area of basic geometric figures. To add

More information

Understanding Intents and Intent Filters

Understanding Intents and Intent Filters 255 Chapter 11 Understanding Intents and Intent Filters This chapter will delve into intents, which are messaging objects that carry communications between the major components of your application your

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: 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

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. 1 Thread A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. Each virtual machine instance has at least one main

More information

Embedded Systems Programming - PA8001

Embedded Systems Programming - PA8001 Embedded Systems Programming - PA8001 http://goo.gl/ydeczu Lecture 9 Mohammad Mousavi m.r.mousavi@hh.se Center for Research on Embedded Systems School of Information Science, Computer and Electrical Engineering

More information

Camera and Intent. Elena Fortini

Camera and  Intent. Elena Fortini Camera and Email Intent Elena Fortini An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several

More information

Intents. Your first app assignment

Intents. Your first app assignment Intents Your first app assignment We will make this. Decidedly lackluster. Java Code Java Code XML XML Preview XML Java Code Java Code XML Buttons that work

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

Create Parent Activity and pass its information to Child Activity using Intents.

Create Parent Activity and pass its information to Child Activity using Intents. Create Parent Activity and pass its information to Child Activity using Intents. /* MainActivity.java */ package com.example.first; import android.os.bundle; import android.app.activity; import android.view.menu;

More information

Lab 1: Getting Started With Android Programming

Lab 1: Getting Started With Android Programming Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Eng. Jehad Aldahdooh Mobile Computing Android Lab Lab 1: Getting Started With Android Programming To create a new Android Project

More information

Applications. Marco Ronchetti Università degli Studi di Trento

Applications. Marco Ronchetti Università degli Studi di Trento Applications Marco Ronchetti Università degli Studi di Trento Android Applications An Android application typically consists of one or more related, loosely bound activities for the user to interact with.

More information

LifeStreet Media Android Publisher SDK Integration Guide

LifeStreet Media Android Publisher SDK Integration Guide LifeStreet Media Android Publisher SDK Integration Guide Version 1.12.0 Copyright 2015 Lifestreet Corporation Contents Introduction... 3 Downloading the SDK... 3 Choose type of SDK... 3 Adding the LSM

More information

what we will cover - setting up multiple activities - intents - lab 2 What you need to know for Lab 2

what we will cover - setting up multiple activities - intents - lab 2 What you need to know for Lab 2 what we will cover - setting up multiple activities - intents What you need to know for Lab 2 - lab 2 multiple activities are used in lab 2 to manage different screens we need to set up different activities

More information

Android Data Storage

Android Data Storage Lesson 14 Android Persistency: Victor Matos Cleveland State University Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright 2008-2009 CommonsWare, LLC. ISBN: 978-0-9816780-0-9

More information

Introduction To Android

Introduction To Android Introduction To Android Mobile Technologies Symbian OS ios BlackBerry OS Windows Android Introduction to Android Android is an operating system for mobile devices such as smart phones and tablet computers.

More information

UNDERSTANDING ACTIVITIES

UNDERSTANDING ACTIVITIES Activities Activity is a window that contains the user interface of your application. An Android activity is both a unit of user interaction - typically filling the whole screen of an Android mobile device

More information

THE CATHOLIC UNIVERSITY OF EASTERN AFRICA A. M. E. C. E. A

THE CATHOLIC UNIVERSITY OF EASTERN AFRICA A. M. E. C. E. A THE CATHOLIC UNIVERSITY OF EASTERN AFRICA A. M. E. C. E. A MAIN EXAMINATION P.O. Box 62157 00200 Nairobi - KENYA Telephone: 891601-6 Fax: 254-20-891084 E-mail:academics@cuea.edu AUGUST - DECEMBER 2016

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Saving State THE PROBLEM How to save the state (of a UI, for instance) so that it survives even when the application is closed/killed The state should

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

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation 1. Location Services 1.1 GPS Location 1. Create the Android application with the following attributes. Application Name: MyLocation Project Name: Package Name: MyLocation com.example.mylocation 2. Put

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

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

8/30/15 MOBILE COMPUTING. CSE 40814/60814 Fall How many of you. have implemented a command-line user interface?

8/30/15 MOBILE COMPUTING. CSE 40814/60814 Fall How many of you. have implemented a command-line user interface? MOBILE COMPUTING CSE 40814/60814 Fall 2015 How many of you have implemented a command-line user interface? 1 How many of you have implemented a graphical user interface? HTML/CSS Java Swing.NET Framework

More information

SMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0

SMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 SMAATSDK NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 NFC Module on Android Requirements and Documentation Table of contents Scope...3 Purpose...3 General operating diagram...3 Functions

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

Computer Science E-76 Building Mobile Applications

Computer Science E-76 Building Mobile Applications Computer Science E-76 Building Mobile Applications Lecture 3: [Android] The SDK, Activities, and Views February 13, 2012 Dan Armendariz danallan@mit.edu 1 http://developer.android.com Android SDK and NDK

More information

Outline. Admin. Example: TipCalc. Android: Event Handler Blocking, Android Inter-Thread, Process Communications. Recap: Android UI App Basic Concepts

Outline. Admin. Example: TipCalc. Android: Event Handler Blocking, Android Inter-Thread, Process Communications. Recap: Android UI App Basic Concepts Outline Android: Event Handler Blocking, Android Inter-Thread, Process Communications 10/11/2012 Admin Android Basic concepts Activity, View, External Resources, Listener Inter-thread communications Handler,

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

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

Action Bar. (c) 2010 Haim Michael. All Rights Reserv ed.

Action Bar. (c) 2010 Haim Michael. All Rights Reserv ed. Action Bar Introduction The Action Bar is a widget that is shown on top of the screen. It includes the application logo on its left side together with items available from the options menu on the right.

More information

App Development for Smart Devices. Lec #18: Advanced Topics

App Development for Smart Devices. Lec #18: Advanced Topics App Development for Smart Devices CS 495/595 - Fall 2011 Lec #18: Advanced Topics Tamer Nadeem Dept. of Computer Science Objective Web Browsing Android Animation Android Backup Presentation - Developing

More information

Android Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)

Android Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Android Specifics Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Android Specifics ArrayAdapter Preferences Widgets Jonathan Diehl, Hendrik Thüs 2 ArrayAdapter Jonathan Diehl, Hendrik Thüs

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

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

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 AND-401. Android Application Development. Download Full Version :

Android AND-401. Android Application Development. Download Full Version : Android AND-401 Android Application Development Download Full Version : http://killexams.com/pass4sure/exam-detail/and-401 QUESTION: 113 Consider the following :

More information

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Programming with Android: Introduction Layouts Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Views: outline Main difference between a Drawable and

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

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 Comment and Evaluation: This lab introduces us about Android SDK and how to write a program for Android platform. The calculator is pretty easy, everything

More information

COMP4521 EMBEDDED SYSTEMS SOFTWARE

COMP4521 EMBEDDED SYSTEMS SOFTWARE COMP4521 EMBEDDED SYSTEMS SOFTWARE LAB 1: DEVELOPING SIMPLE APPLICATIONS FOR ANDROID INTRODUCTION Android is a mobile platform/os that uses a modified version of the Linux kernel. It was initially developed

More information

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MAD ASSIGNMENT NO 3 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MainActivity.java File package com.example.tutorialspoint; import android.manifest;

More information

Getting started: Installing IDE and SDK. Marco Ronchetti Università degli Studi di Trento

Getting started: Installing IDE and SDK. Marco Ronchetti Università degli Studi di Trento Getting started: Installing IDE and SDK Marco Ronchetti Università degli Studi di Trento Alternative: Android Studio http://developer.android.com/develop/index.html 2 Tools behind the scenes dx allows

More information

Hybrid Apps Combining HTML5 + JAVASCRIPT + ANDROID

Hybrid Apps Combining HTML5 + JAVASCRIPT + ANDROID Hybrid Apps Combining HTML5 + JAVASCRIPT + ANDROID Displaying Web Page For displaying web page, two approaches may be adopted: 1. Invoke browser application: In this case another window out side app will

More information

Lecture 7: Data Persistence : shared preferences. Lecturer : Ali Kadhim Al-Bermani Mobile Fundamentals and Programming

Lecture 7: Data Persistence : shared preferences. Lecturer : Ali Kadhim Al-Bermani Mobile Fundamentals and Programming University of Babylon College of Information Technology Department of Information Networks Mobile Fundamentals and Programming Lecture 7: Data Persistence : shared preferences Lecturer : Ali Kadhim Al-Bermani

More information

Meniu. Create a project:

Meniu. Create a project: Meniu Create a project: Project name: P0131_MenuSimple Build Target: Android 2.3.3 Application name: MenuSimple Package name: ru.startandroid.develop.menusimple Create Activity: MainActivity Open MainActivity.java.

More information

Database Development In Android Applications

Database Development In Android Applications ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Database Development In Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran

More information

Manifest.xml. Activity.java

Manifest.xml. Activity.java Dr.K.Somasundaram Ph.D Professor Department of Computer Science and Applications Gandhigram Rural Institute, Gandhigram, Tamil Nadu-624302, India ka.somasundaram@gmail.com Manifest.xml

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

Intents and Intent Filters

Intents and Intent Filters Intents and Intent Filters Intent Intent is an messaging object. There are three fundamental use cases: Starting an activity: Intent intent = new Intent(this, SecondActivity.class); startactivity(intent);

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

CS 234/334 Lab 1: Android Jump Start

CS 234/334 Lab 1: Android Jump Start CS 234/334 Lab 1: Android Jump Start Distributed: January 7, 2014 Due: Friday, January 10 or Monday, January 13 (in-person check off in Mobile Lab, Ry 167). No late assignments. Introduction The goal of

More information

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27 Android Coding Dr. J.P.E. Hodgson August 23, 2010 Dr. J.P.E. Hodgson () Android Coding August 23, 2010 1 / 27 Outline Starting a Project 1 Starting a Project 2 Making Buttons Dr. J.P.E. Hodgson () Android

More information

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2 Workshop 1. Compare different layout by using Change Layout button (Page 1 5) Relative Layout Linear Layout (Horizontal) Linear Layout (Vertical) Frame Layout 2. Revision on basic programming skill - control

More information

Security model. Marco Ronchetti Università degli Studi di Trento

Security model. Marco Ronchetti Università degli Studi di Trento Security model Marco Ronchetti Università degli Studi di Trento Security model 2 Android OS is a multi-user Linux in which each application is a different user. By default, the system assigns each application

More information

Faculty of Engineering Computer Engineering Department Islamic University of Gaza Network Lab # 7 Permissions

Faculty of Engineering Computer Engineering Department Islamic University of Gaza Network Lab # 7 Permissions Faculty of Engineering Computer Engineering Department Islamic University of Gaza 2012 Network Lab # 7 Permissions Objective: Network Lab # 7 Permissions Define permissions. Explain the characteristics

More information

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Diving into Android. By Jeroen Tietema. Jeroen Tietema, Diving into Android By Jeroen Tietema Jeroen Tietema, 2015 1 Requirements 4 Android SDK 1 4 Android Studio (or your IDE / editor of choice) 4 Emulator (Genymotion) or a real device. 1 See https://developer.android.com

More information

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering Getting Started Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador 1 Goals Setting up your development environment Android Framework

More information

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator. Simple Android Application for Native Calculator Aim: To develop a Simple Android Application for Native Calculator. Procedure: Creating a New project: Open Android Stdio and then click on File -> New

More information

Getting started: Hello Android. Marco Ronchetti Università degli Studi di Trento

Getting started: Hello Android. Marco Ronchetti Università degli Studi di Trento Getting started: Hello Android Marco Ronchetti Università degli Studi di Trento HelloAndroid package com.example.helloandroid; import android.app.activity; import android.os.bundle; 2 public class HelloAndroid

More information