Terms: MediaPlayer, VideoView, MediaController,

Size: px
Start display at page:

Download "Terms: MediaPlayer, VideoView, MediaController,"

Transcription

1 Terms: MediaPlayer, VideoView, MediaController, Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: Phone:

2 MediaPlayer The playback of audio and video in Android is handled mostly by the MediaPlayer class To play a media resource you need to create a new MediaPlayer instance, initialize it with a media source, and prepare it for playback For playing media may be stored in application resources, local files, Content Providers, or streamed from a network URL In each case, the file format and type of multimedia being played is provided 2

3 Playback Audio To play back audio content using Media Player, a Media Player object should be created Media Player object may be created using create method: This requires application context and audio source location Using default constructor: After constructor, use setdatasource method to provide audio source location and call prepare method to prepare for playback 3

4 MediaPlayer.Create : Examples An application resource identifier (stored in res/raw folder) MediaPlayer resourceplayer = MediaPlayer.create(this, R.raw.my_audio); A URI to a local file using the file:// schema MediaPlayer fileplayer = MediaPlayer.create(this, Uri.parse( file:///sdcard/localfile.mp3 )); A URI to an online audio resource as a URL MediaPlayer urlplayer = MediaPlayer.create(this, Uri.parse( )); A URI to a local Content Provider row MediaPlayer contentplayer = MediaPlayer.create(this, Settings.System.DEFAULT_RINGTONE_URI); 4

5 MediaPlayer: Using Constructor MediaPlayer mediaplayer = new MediaPlayer(); mediaplayer.setdatasource("/sdcard/test.3gp"); mediaplayer.prepare(); For starting the Audio use MediaPlayer.start method Use MediaController.MediaPlayerControl to show the 5

6 Audio Files in Application Package Put your mp3 or video data in raw folder A audio files can be included in application package by adding them to the res/raw folder of resources hierarchy. File name should be in small letters Eg-abc.mp3,or abs.3gp 6

7 Playback Audio : Demo For Stop For Pause For Play 7

8 Playback Video To show a video, you must specify a display surface on which to show it. There are two alternatives for the playback of video content. The first, using the Video View control, encapsulates the creation of a display surface and allocation and preparation of video content within a Media Player. The second technique allows you to specify your own display surface and manipulate the underlying Media Player instance directly. 8

9 Playback Video: Using Video View The simplest way to play back video is to use the VideoView control The Video View includes a Surface on which the video is displayed and encapsulates and manages a Media Player to manage the video playback. The Video View supports the playback of local or streaming video as supported by the Media Player component. 9

10 Playback Video: Using Video View.. Place Video Views control in UI, get a reference to it within your code To assign a video to play, call setvideopath or setvideouri to specify the path to a local file, or the URI of a Content Provider or remote video stream: streamingvideoview.setvideouri(" localvideoview.setvideopath("/sdcard/test2.3gp"); Media Controller can be used to control video play-back, simply by the Video View s setmediacontroller method: MediaController mediacontroller = new MediaController(this); videoview.setmediacontroller(mediacontroller); 10

11 Playback Video: Example VideoView videoview = (VideoView)findViewById(R.id.surface); videoview.setkeepscreenon(true); videoview.setvideopath("/sdcard/test2.3gp"); if (videoview.canseekforward()) videoview.seekto(videoview.getduration()/2); videoview.start(); [... do something... ] videoview.stopplayback(); // Attach a Media Controller MediaController mediacontroller = new MediaController(this); videoview.setmediacontroller(mediacontroller); 11

12 Playback Video: Using Video View Video View 12

13 Playback Video: Using Media Player.. Setting up a Surface for Video Playback- TheMedia Player requires a SurfaceHolder object for displaying video content, assigned using the setdisplay method. 13

14 Playback Video: Media Player <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <SurfaceView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> </SurfaceView> </LinearLayout> 14

15 Playback Video: Media Player Note that you must implement the SurfaceHolder.Callback interface. Surface Holders are created asynchronously, so you must wait until the surfacecreated handler has been fired before assigning the returned Surface Holder object to the Media Player. 15

16 Playback Video: Media Player Viodeo view on emulator 16

17 Playback Video: Media Player Playing Video 17

18 Record Video: Media Recorder Audio capture from the device is a bit more complicated than audio and video playback, but still fairly simple: Create a new instance of android.media.mediarecorder. Set the audio source using MediaRecorder.setAudioSource(). You will probably want to use MediaRecorder.AudioSource.MIC. Set output file format using MediaRecorder.setOutputFormat(). Set output file name using MediaRecorder.setOutputFile(). Set the audio encoder using MediaRecorder.setAudioEncoder(). Call MediaRecorder.prepare() on the MediaRecorder instance. To start audio capture, call MediaRecorder.start(). To stop audio capture, call MediaRecorder.stop(). When you are done with the MediaRecorder instance, call MediaRecorder.release() on it. Calling MediaRecorder.release() is always recommended to free the resource immediately. 18

19 Android Camera API

20 Android Camera The Android framework supports capturing images and video through the Camera API or camera Intent. Here are the relevant classes: o Camera: This class is the primary API for controlling device cameras. This class is used to take pictures or videos when you are building a camera application o SurfaceView: This class is used to present a live camera preview to the user o MediaRecorder: This class is used to record video from the camera o Intent : An intent action type of MediaStore. ACTION_IMAGE_CAPTURE or MediaStore. ACTION_VIDEO_CAPTURE can be used to capture images or videos without directly using the Camera object

21 Manifest Declarations(Permissions) Before starting development on your application with the Camera API, you should make sure your manifest has the appropriate declarations to allow use of camera hardware and other related features. o Camera Permission - Your application must request permission to use a device camera <uses-permission android:name="android.permission.camera" /> o Camera Features - Your application must also declare use of camera features, for example: <uses-feature android:name="android.hardware.camera" />

22 Manifest Declarations(Permissions) o Storage Permission - If your application saves images or videos to the device's external storage (SD Card), you must also specify this in the manifest. <uses-permission android:name="android.permission.write_external_storage /> o Audio Recording Permission - For recording audio with video capture, your application must request the audio capture permission. <uses-permission android:name="android.permission.record_audio /> o Location Permission - If your application tags images with GPS location information, you must request location permission: <uses-permission android:name="android.permission.access_fine_location />

23 Using Existing Camera Apps The procedure for invoking a camera intent follows these general steps: Compose a Camera Intent - Create an Intent that requests an image or video, using one of these intent types: MediaStore.ACTION_IMAGE_CAPTURE - Intent action type for requesting an image from an existing camera application. MediaStore.ACTION_VIDEO_CAPTURE - Intent action type for requesting a video from an existing camera application. Start the Camera Intent - Use the startactivityforresult() method to execute the camera intent. After you start the intent, the Camera application user interface appears on the device screen and the user can take a picture or video. Receive the Intent Result - Set up an onactivityresult() method in your application to receive the callback and data from the camera intent. When the user finishes taking a picture or video (or cancels the operation), the system calls this method.

24 Example 1. Image capture intent Capturing images using a camera intent is quick way to enable your application to take pictures with minimal coding. An image capture intent can include the following extra information: MediaStore.EXTRA_OUTPUT - This setting requires a Uri object specifying a path and file name where you'd like to save the picture. This setting is optional but strongly recommended. If you do not specify this value, the camera application saves the requested picture in the default location with a default name, specified in the returned intent's Intent.getData() field.

25 Example 1. Image capture intent private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 100; private Uri public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); // create Intent to take a picture and return control to the calling application Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileuri = getoutputmediafileuri(media_type_image); // create a file to save the image intent.putextra(mediastore.extra_output, fileuri); // set the image file name } // start the image capture Intent startactivityforresult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

26 Example 2. Video capture intent Capturing video using a camera intent is a quick way to enable your application to take videos with minimal coding. A video capture intent can include the following extra information: MediaStore.EXTRA_OUTPUT - This setting requires a Uri specifying a path and file name where you'd like to save the video. This setting is optional but strongly recommended. If you do not specify this value, the Camera application saves the requested video in the default location with a default name, specified in the returned intent's Intent.getData() field. MediaStore.EXTRA_VIDEO_QUALITY- This value can be 0 for lowest quality and smallest file size or 1 for highest quality and larger file size. MediaStore.EXTRA_DURATION_LIMIT - Set this value to limit the length, in seconds, of the video being captured. MediaStore.EXTRA_SIZE_LIMIT - Set this value to limit the file size, in bytes, of the video being captured. The following example demonstrates how to construct a video capture intent and execute it. The getoutputmediafileuri() method in this example refers to the sample code shown in Saving Media Files.

27 Example :- Example 2. Video capture intent private static final int CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE = 200; private Uri public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); //create new Intent fileuri = getoutputmediafileuri(media_type_video); // create a file to save the video intent.putextra(mediastore.extra_output, fileuri); // set the image file name intent.putextra(mediastore.extra_video_quality, 1); // set the video image quality to high } // start the Video Capture Intent startactivityforresult(intent, CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);

28 Receiving camera intent result In order to receive the result of an intent, you must override the onactivityresult() in the activity that started the intent. The following example demonstrates how to override onactivityresult() to capture the result of the image camera intent or video camera intent examples shown in the previous sections. private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 100; private static final int CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE = protected void onactivityresult(int requestcode, int resultcode, Intent data) { if (requestcode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) { if (resultcode == RESULT_OK) { // Image captured and saved to fileuri specified in the Intent Toast.makeText(this, "Image saved to:\n" + data.getdata(), Toast.LENGTH_LONG).show(); } else if (resultcode == RESULT_CANCELED) { // User cancelled the image capture } else { // Image capture failed, advise user } }

29 Receiving camera intent result if (requestcode == CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE) { if (resultcode == RESULT_OK) { // Video captured and saved to fileuri specified in the Intent Toast.makeText(this, "Video saved to:\n" + data.getdata(), Toast.LENGTH_LONG).show(); } else if (resultcode == RESULT_CANCELED) { // User cancelled the video capture } else { // Video capture failed, advise user } } } //onactivityresult Once your activity receives a successful result, the captured image or video is available in the specified location for your application to access

30 Detecting camera hardware If your application does not specifically require a camera using a manifest declaration, you should check to see if a camera is available at runtime. To perform this check, use the PackageManager.hasSystemFeature()method, as shown in the example code below: /** Check if this device has a camera */ private boolean checkcamerahardware(context context) { if (context.getpackagemanager().hassystemfeature(packagemanager.feature_camera)){ // this device has a camera return true; } else { // no camera on this device return false; } }

31 Accessing cameras o If you have determined that the device on which your application is running has a camera, you must request to access it by getting an instance of Camera (unless you are using an intent to access the camera) o To access the primary camera, use the Camera.open() method and be sure to catch any exceptions, as shown in the code below: /** A safe way to get an instance of the Camera object. */ public static Camera getcamerainstance(){ Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable }

32 Checking camera features Once you obtain access to a camera, you can get further information about its capabilities using the Camera.getParameters() method and checking the returned Camera.Parameters object for supported capabilities. When using API Level 9 or higher, use the Camera.getCameraInfo() to determine if a camera is on the front or back of the device, and the orientation of the image.

33 Camera Features Android supports a wide array of camera features you can control with your camera application, such as picture format, flash mode, focus settings, and many more. This section lists the common camera features, and briefly discusses how to use them. Most camera features can be accessed and set using the through Camera. Parameters object. However, there are several important features that require more than simple settings in Camera. Parameters These features are covered in the following sections: Metering and focus areas Face detection Time lapse video

App Development for Smart Devices. Lec #12: Audio and Video

App Development for Smart Devices. Lec #12: Audio and Video App Development for Smart Devices CS 495/595 - Fall 2011 Lec #12: Audio and Video Tamer Nadeem Dept. of Computer Science Objective Playing Audio & Video Media Player Recording Audio & Video Media Recorder

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

<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

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

App Development for Smart Devices. Lec #7: Audio, Video & Telephony Try It Out

App Development for Smart Devices. Lec #7: Audio, Video & Telephony Try It Out App Development for Smart Devices CS 495/595 - Fall 2013 Lec #7: Audio, Video & Telephony Try It Out Tamer Nadeem Dept. of Computer Science Trt It Out Example - SoundPool Example - VideoView Page 2 Fall

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

Android Debug Framework Android Debug Framework (Logcat, DDMS, Debug, Exception Handling, Third Party APIs) Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: www.sisoft.in

More information

1 카메라 1.1 제어절차 1.2 관련주요메서드 1.3 제작철차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다.

1 카메라 1.1 제어절차 1.2 관련주요메서드 1.3 제작철차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다. 1 카메라 1.1 제어절차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다. 1.2 관련주요메서드 setpreviewdisplay() : startpreview() : stoppreview(); onpicturetaken() : 사진을찍을때자동으로호출되며캡처한이미지가전달됨 1.3 제작철차 Step 1 프로젝트를생성한후매니페스트에퍼미션들을설정한다.

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

Mobila applikationer och trådlösa nät

Mobila applikationer och trådlösa nät Mobila applikationer och trådlösa nät HI1033 Lecture 8 Today s topics Location Based Services Google Maps API MultiMedia Location Based Services LocationManager provides access to location based services

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

6.Introducing Classes 9. Exceptions

6.Introducing Classes 9. Exceptions 6.Introducing Classes 9. Exceptions 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 Learning

More information

Multimedia Support Classes Playing Audio Watching Video Recording Audio

Multimedia Support Classes Playing Audio Watching Video Recording Audio Multimedia Support Classes Playing Audio Watching Video Recording Audio Android provides support for encoding and decoding a variety of common media formats Allows you to play & record audio, still images

More information

Android permissions Defining and using permissions Component permissions and related APIs

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

More information

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

Text Properties Data Validation Styles/Themes Material Design

Text Properties Data Validation Styles/Themes Material Design Text Properties Data Validation Styles/Themes Material Design Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: Email:info@sisoft.in Phone: +91-9999-283-283

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

Packages Inner Classes

Packages Inner Classes Packages Inner Classes 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 Learning - Topics

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

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

Android Camera. Alexander Nelson October 6, University of Arkansas - Department of Computer Science and Computer Engineering

Android Camera. Alexander Nelson October 6, University of Arkansas - Department of Computer Science and Computer Engineering Android Camera Alexander Nelson October 6, 2017 University of Arkansas - Department of Computer Science and Computer Engineering Why use the camera? Why not? Translate Call Learn Capture How to use the

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

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

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

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II) ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II) Media Playback Engine Android provides a media playback engine at the native level called Stagefright that comes built-in with software-based

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

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

ANDROID SDK. Developers Guide

ANDROID SDK. Developers Guide ANDROID SDK Developers Guide Content description This is a reference manual and configuration guide for the NeoCheck Document Verification Android SDK product. It shows how to interact with the Xamarin

More information

Declaring Array Variable

Declaring Array Variable 5. Arrays 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 Array Arrays are used typically

More information

Android. Soft Keyboard Graphics and Media

Android. Soft Keyboard Graphics and Media Android Soft Keyboard Graphics and Media Soft keyboards Devices can have hard keyboards or only a directional pad (arrows plus select) But most don t have keyboards All have soft keyboards controlled by

More information

EMBEDDED SYSTEMS PROGRAMMING Android Services

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

More information

Activities. https://developer.android.com/guide/components/activities.html Repo: https://github.com/karlmorris/basicactivities

Activities. https://developer.android.com/guide/components/activities.html Repo: https://github.com/karlmorris/basicactivities Activities https://developer.android.com/guide/components/activities.html Repo: https://github.com/karlmorris/basicactivities Overview What is an Activity Starting and stopping activities The Back Stack

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

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

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

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

Introduction to Mobile Application Development Using Android Week Four Video Lectures

Introduction to Mobile Application Development Using Android Week Four Video Lectures Introduction to Mobile Application Development Using Android Week Four Video Lectures Week Four: Lecture 1: Unit 1: Multimedia Multimedia Support in Android Multimedia Support in Android We are now going

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

Comp 595MC/L: Mobile Computing CSUN Computer Science Department Fall 2013 Midterm

Comp 595MC/L: Mobile Computing CSUN Computer Science Department Fall 2013 Midterm Comp 595MC/L: Mobile Computing CSUN Computer Science Department Fall 2013 Midterm Time: 50 minutes Good news: You can use ONE sheet of notes. Bad news: Closed book, no electronic computing or communications

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

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

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

Android writing files to the external storage device

Android writing files to the external storage device Android writing files to the external storage device The external storage area is what Android knows as the SD card. There is a virtual SD card within the Android file system although this may be of size

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

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

Mul$media Techniques in Android. Some of the informa$on in this sec$on is adapted from WiseAndroid.com

Mul$media Techniques in Android. Some of the informa$on in this sec$on is adapted from WiseAndroid.com Mul$media Techniques in Android Some of the informa$on in this sec$on is adapted from WiseAndroid.com Mul$media Support Android provides comprehensive mul$media func$onality: Audio: all standard formats

More information

Data Types, Literals, Operators

Data Types, Literals, Operators Data Types, Literals, Operators 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 Learning

More information

Android Workshop: Model View Controller ( MVC):

Android Workshop: Model View Controller ( MVC): Android Workshop: Android Details: Android is framework that provides java programmers the ability to control different aspects of smart devices. This interaction happens through the Android SDK (Software

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

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

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

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

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

Upcoming Assignments Quiz Friday? Lab 5 due today Alpha Version due Friday, February 26

Upcoming Assignments Quiz Friday? Lab 5 due today Alpha Version due Friday, February 26 Upcoming Assignments Quiz Friday? Lab 5 due today Alpha Version due Friday, February 26 Inject one subtle defect (fault seeding) To be reviewed by a few class members Usability study by CPE 484 students

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

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

Solving an Android Threading Problem

Solving an Android Threading Problem Home Java News Brief Archive OCI Educational Services Solving an Android Threading Problem Introduction by Eric M. Burke, Principal Software Engineer Object Computing, Inc. (OCI) By now, you probably know

More information

Real-Time Embedded Systems

Real-Time Embedded Systems Real-Time Embedded Systems DT8025, Fall 2016 http://goo.gl/azfc9l Lecture 8 Masoumeh Taromirad m.taromirad@hh.se Center for Research on Embedded Systems School of Information Technology 1 / 51 Smart phones

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

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

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

Software Practice 3 Today s lecture Today s Task

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

More information

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

RUNTIME PERMISSIONS IN ANDROID 6.0 Lecture 10a

RUNTIME PERMISSIONS IN ANDROID 6.0 Lecture 10a RUNTIME PERMISSIONS IN ANDROID 6.0 Lecture 10a COMPSCI 702 Security for Smart-Devices Muhammad Rizwan Asghar March 20, 2018 2 ANDROID 6.0 A version of the Android mobile operating system officially released

More information

Basic I/O - Stream. Java.io (stream based IO) Java.nio(Buffer and channel-based IO)

Basic I/O - Stream. Java.io (stream based IO) Java.nio(Buffer and channel-based IO) I/O and Scannar 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 I/O operations Three steps:

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

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

Arrays of Buttons. Inside Android

Arrays of Buttons. Inside Android Arrays of Buttons Inside Android The Complete Code Listing. Be careful about cutting and pasting.

More information

Embedded Systems Programming - PA8001

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

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

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

Android Programming Lecture 8: Activities, Odds & Ends, Two New Views 9/28/2011

Android Programming Lecture 8: Activities, Odds & Ends, Two New Views 9/28/2011 Android Programming Lecture 8: Activities, Odds & Ends, Two New Views 9/28/2011 Return Values from Activities: Callee Side How does the Sub-Activity send back a response? Create an Intent to return Stuff

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

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza Data persistence Shared preferences A method to store primitive data in android as key-value pairs, these saved data will

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

CS378 -Mobile Computing. Audio

CS378 -Mobile Computing. Audio CS378 -Mobile Computing Audio Android Audio Use the MediaPlayer class Common Audio Formats supported: MP3, MIDI (.mid and others), Vorbis(.ogg), WAVE (.wav) and others Sources of audio local resources

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

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion External Services CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion 1 External Services Viewing websites Location- and map-based functionality

More information

COMP4521 EMBEDDED SYSTEMS SOFTWARE

COMP4521 EMBEDDED SYSTEMS SOFTWARE COMP4521 EMBEDDED SYSTEMS SOFTWARE LAB 5: USING WEBVIEW AND USING THE NETWORK INTRODUCTION In this lab we modify the application we created in the first three labs. Instead of using the default browser,

More information

Mensch-Maschine-Interaktion 2 Übung 12

Mensch-Maschine-Interaktion 2 Übung 12 Mensch-Maschine-Interaktion 2 Übung 12 Ludwig-Maximilians-Universität München Wintersemester 2010/2011 Michael Rohs 1 Preview Android Development Tips Location-Based Services and Maps Media Framework Android

More information

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) Network Connection Web Service K Candra Brata andra.course@gmail.com Mobille App Lab 2015-2016 Network Connection http://developer.android.com/training/basics/network-ops/connecting.html

More information

Vienos veiklos būsena. Theory

Vienos veiklos būsena. Theory Vienos veiklos būsena Theory While application is running, we create new Activities and close old ones, hide the application and open it again and so on, and Activity can process all these events. It is

More information

GATAV 5. Animations Using a Game Loop

GATAV 5. Animations Using a Game Loop GATAV 5. Animations Using a Game Loop TOC 1. The basic principle. 2. Creating bubbles. 3. Making the bubbles more look alive. 4. The appearent look. 5. Making the audiance impressed. 6. Now it up to you:

More information

Advanced Android Development

Advanced Android Development Advanced Android Development review of greporter open-source project: GPS, Audio / Photo Capture, SQLite, HTTP File Upload and more! Nathan Freitas, Oliver+Coady nathan@olivercoady.com Android Platform

More information

Pro Android 2. Sayed Y. Hashimi Satya Komatineni Dave Mac Lean. Apress

Pro Android 2. Sayed Y. Hashimi Satya Komatineni Dave Mac Lean. Apress Pro Android 2 Sayed Y. Hashimi Satya Komatineni Dave Mac Lean Apress Contents Contents at a Glance Contents About the Authors About the Technical Reviewer Acknowledgments Foreword iv v xiii xiv xv xvi

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Managing Screen Orientation ORIENTATIONS Portrait Landscape Reverse portrait Reverse landscape ON REVERSE PORTRAIT Android: all four orientations are

More information

Android & iphone. Amir Eibagi. Localization

Android & iphone. Amir Eibagi. Localization Android & iphone Amir Eibagi Localization Topics Android Localization: Overview Language & Strings Country/region language variations Images & Media Currency, date & Time iphone Localization Language &

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

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

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

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

Notification mechanism

Notification mechanism Notification mechanism Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Portions of this page are reproduced from work created

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

The Internet. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046

The Internet. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046 The Internet CS 2046 Mobile Application Development Fall 2010 Announcements HW2 due Monday, 11/8, at 11:59pm If you want to know what it means to root your phone, or what this does, see Newsgroup HW1 grades

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

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

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

05. RecyclerView and Styles

05. RecyclerView and Styles 05. RecyclerView and Styles 08.03.2018 1 Agenda Intents Creating Lists with RecyclerView Creating Cards with CardView Application Bar Menu Styles and Themes 2 Intents 3 What is Intent? An Intent is an

More information

android:orientation="horizontal" android:layout_margintop="30dp"> <Button android:text="button2"

android:orientation=horizontal android:layout_margintop=30dp> <Button android:text=button2 Parametrų keitimas veikiančioje aplikacijoje Let s create a project: Project name: P0181_DynamicLayout3 Build Target: Android 2.3.3 Application name: DynamicLayout3 Package name: ru.startandroid.develop.dynamiclayout3

More information

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology Android App Development Mr. Michaud ICE Programs Georgia Institute of Technology Android Operating System Created by Android, Inc. Bought by Google in 2005. First Android Device released in 2008 Based

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