What's Happening Today Working with Images

Slides:



Advertisements
Similar presentations
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
Advertisements

The Android Activity Lifecycle. Slide 2 Introduction Working with the Android logging system Rotation and multiple layouts Understanding the Android activity.
Spring 2010ACS-3913 Ron McFadyen1 Weather Station Page 39+ In this application, weather station devices supply data to a weather data object. As the data.
Android Life Cycle CS328 Dick Steflik. Life Cycle The steps that an application goes through from starting to finishing Slightly different than normal.
Mobile Programming Pertemuan 6 Presented by Mulyono Poltek NSC Surabaya.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Intro to Android Programming George Nychis Srinivasan Seshan.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
1 Localization and Sensing Nilanjan Banerjee Mobile Systems Programming (Acknowledgement: Jules White) University of Arkansas Fayetteville, AR
Sensing. Possible sensors on devices – Documented in SensorEvent class Accelerometer (m/s 2 ) – acceleration in x, y, z axes Magnetic Field (micro Tesla)
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
Cosc 5/4730 Broadcast Receiver. Broadcast receiver A broadcast receiver (short receiver) – is an Android component which allows you to register for system.
Mobile Application Development using Android Lecture 2.
DUE Hello World on the Android Platform.
CS378 - Mobile Computing Intents.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Sensors – Part I SE 395/595.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Activity Android Club Agenda Hello Android application Application components Activity StartActivity.
Mobile Programming Midterm Review
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
Speech Service & client(Activity) 오지영.
Services. What is a Service? A Service is not a separate process. A Service is not a thread. A Service itself is actually very simple, providing two main.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Java for android Development Nasrullah Khan. Using instanceof in Android Development the classes such as Button, TextView, and CheckBox, which represent.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Sensors in Android.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors
Android Application -Architecture.
Java SWING and Model View Controller (MVC)
Plan for today Toward debugging and understanding
CS371m - Mobile Computing Services and Broadcast Receivers
Basic Activities and Intents
Reactive Android Development
Instructor: Mazhar Hussain
Android Studio, Android System Basics and Git
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
MAD.
Android Mobile Application Development
Singleton Pattern Command Pattern
INFOD-WG Implementation
The Android Activity Lifecycle
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS499 – Mobile Application Development
Lesson 1: Buttons and Events – 12/18
Chapter 16 – Programming your App’s Memory
Android Programming Lecture 9
Android App Developing with communication included
Application Development A Tutorial Driven Course
Event Driven Programming
Android Topics UI Thread and Limited processing resources
Observer Design Pattern
Android Topics Asynchronous Callsbacks
Android Programming Tutorial
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Tonga Institute of Higher Education
Android Developer Fundamentals V2 Lesson 5
It is used to Start an Activity Start a Service Deliver a Broadcast
SE4S701 Mobile Application Development
Android Development Tools
Activities, Fragments, and Intents
Presentation transcript:

What's Happening Today Working with Images What does this mean for the UI? What does this mean for resources? What about shaking things up? What happens when you slip the schedule? … ...

Android Sensors https://developer.android.com/guide/topics/sensors/sensors_overview.html Sensors come in several flavors We'll only use accelerometer in examples Use is similar to other Android features Register Sensor in AndroidManifest.XML <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />

Registering/Using Sensor Typical of Observable Design Pattern https://en.wikipedia.org/wiki/Observer_pattern AKA Publish Subscribe Observer is registered with Observable, which typically could have several observers See code for getting SensorManager and the sensor/accelerometer RecyclerViewActivity

Create SensorEventListener This is the Observer in design pattern Standard Android, we use ShakeDetector and implement the Interface http://jasonmcreynolds.com/?p=388 Notice nested Interface in ShakeDetector Register a listener with this detector, what is doing the listening? Activity indirectly

Activity Life Cycle Code in onResume and onPause to handle the SensorManager and ShakeDetector What might happen in onPause if not unregistered? What does "listening" do? What's important in App management? Sensor can continue to collect data, but not be able to do anything with data

Android aside in ShakeDetector Notice float values in SensorManager What about value returned Math.sqrt? Is there an issue between float and double? Documentation for Android says … https://developer.android.com/training/articles/perf-tips.html What are the key take-aways on that page?

Code to handle shakes … Anonymous inner class to implement the OnShakeListener interface Expedient (?) way to call a method in the Activity, note the local method Take advantage of RecylerView Adapter Attention to all components in Adapter, e.g., The ViewHolder What happens in method updateList ?

Handling ClickEvents Another example of Observer pattern How does this happen with CardView? Examine RecyclerView.ViewHolder … Is this bound to position? How to test? What if we wanted to do more with click, not simply create a Toast How do we notify another Activity?

What is an Intent? Start one activity from another Start a service Launch when something happens Start a service Camera, phone, music player Broadcast message (app or service) Apps can respond

Intent basics Create Intent, provide Activity class Launch with method startActivity Store "extras" in intent to pass information from one activity to another Can also start activity and "wait" for result See these examples later