Location and Sensors



Similar documents
Android Sensors. CPRE 388 Fall 2015 Iowa State University

Android Sensors. XI Jornadas SLCENT de Actualización Informática y Electrónica

E0-245: ASP. Lecture 16+17: Physical Sensors. Dipanjan Gope

CS 403X Mobile and Ubiquitous Computing Lecture 6: Maps, Sensors, Widget Catalog and Presentations Emmanuel Agu

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

APPFORUM2014. Helping the developer community build next-generation, multi-platform apps. SCHAUMBURG, ILLINOIS SEPTEMBER 8-10

Android Sensors. Mobile Applica1ons Jay Urbain, Ph.D. Credits:

Mobile applications can benefit from being location-aware This mean to allow application to determine and manipulate location For example:

( Modified from Original Source at )

06 Team Project: Android Development Crash Course; Project Introduction

NFC in Android. Martijn Coenen

Sensors. Marco Ronchetti Università degli Studi di Trento

Fitness Motion Recognition

Towards an Internet of Things: Android meets NFC. Dipartimento di Scienze dell Informazione Università di Bologna

Using the Android Sensor API

Sensori and its Advantages

DEVELOPING NFC APPS for BLACKBERRY

Developing NFC Applications on the Android Platform. The Definitive Resource

Developing Sensor Applications on Intel Atom Processor-Based Android* Phones and Tablets

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Programming Mobile Applications with Android

INTERMEDIATE ANDROID DEVELOPMENT Course Syllabus

TUTORIAL. BUILDING A SIMPLE MAPPING APPLICATION

Mobilelogging: Assessing Smartphone Sensors for Monitoring Sleep Behaviour

jsug.at University of Technology Vienna October 25 th 2010 Android Sensors by Stefan Varga, Michal Kostic touchqode.com

Mobile Payment using HCE and mpoint payment gateway based on NFC enabled phones. AUTHOR : GRZEGORZ MILCARZ S111040

Android Geek Night. Application framework

CSE476 Mobile Application Development. Yard. Doç. Dr. Tacha Serif Department of Computer Engineering Yeditepe University

AN How to build a NFC Application on Android. Application note COMPANY PUBLIC. Rev September Document information

THE PRODUCT AUTHENTICATION APPLICATION DESIGN BASED ON NFC

Google Android Syllabus

Grid-In-Hand Mobile Grid Revised 1/27/15

Using Sensors on the Android Platform. Andreas Terzis Android N00b

Lecture 12 Working with Location Sensors and Review

Introduction to Android Programming. Khuong Vu, Graduate student Computer Science department

Near Field Communication (NFC) Android München

CS 696 Mobile Phone Application Development Fall Semester, 2009 Doc 9 Location & Maps Sept 29, 2009

Android app development course

Android in Action. Second Edition. Revised Edition of Unlocking Android MANNING. (74 w. long.) W. FRANK ABLESON CHRIS KING ROBI SEN.

Development of a Mobile Campus Information System

Android Tutorial. Larry Walters OOSE Fall 2011

Google Analytics and Google Analytics Premium: limits and quotas

Location Based Services using Android Mobile Operating System

ID TECH UniMag Android SDK User Manual

Android Programming Lecture 18: Menus Sensors 11/11/2011

Should I Protect You? Understanding Developers Behavior to Privacy-Preserving APIs

Android. Mobile Computing Design and Implementation. Application Components, Sensors. Peter Börjesson

Vulnerability Analysis and Attacks on NFC enabled Mobile Phones

Tegra Android Accelerometer Whitepaper

Google Developer Group Perugia DevFest Central Rome

Develop a Hello World project in Android Studio Capture, process, store, and display an image. Other sensors on Android phones

Training MIFARE SDK. Public. MobileKnowledge June 2015

Introducing Mobile Application Development for Android. Presented by: Ahmed Misbah

NFC Based Equipment Management Inventory System

Module 1: Sensor Data Acquisition and Processing in Android

White Paper. Freeance Mobile for Cityworks

Testing Network Performance and Location Based Services throughout Calling and SMS Applications in Android

An NFC Ticketing System with a new approach of an Inverse Reader Mode

Implementation of Location based Services in Android using GPS and Web Services

Mobile Application Development Android

NFC Test Challenges for Mobile Device Developers Presented by: Miguel Angel Guijarro

An NFC Ticketing System with a new approach of an Inverse Reader Mode

Sensors CS 4720 Web & Mobile Systems

ITG Software Engineering

Mobile NFC 101. Presenter: Nick von Dadelszen Date: 31st August 2012 Company: Lateral Security (IT) Services Limited

Introduction to NaviGenie SDK Client API for Android

E-Tech Corporation REQUIREMENT ANALYSIS REPORT

! Sensors in Android devices. ! Motion sensors. ! Accelerometer. ! Gyroscope. ! Supports various sensor related tasks

Pedometer Project 1 Mr. Michaud /

COURSE CONTENT. GETTING STARTED Select Android Version Create RUN Configuration Create Your First Android Activity List of basic sample programs

A Short Introduction to Android

Precisely Target the Right Audience

Preparing Log-ic 360 USB Loggers for Use

Android on Intel Course App Development - Advanced

Field Properties Quick Reference

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Spring Design ScreenShare Service SDK Instructions

Training. NFC in Android. Public. MobileKnowledge October 2015

Android Concepts and Programming TUTORIAL 1

Mobile Print/Scan Guide for Brother iprint&scan (Android )

4/26/2012. Google TV Seamless integration of TV, Web and Apps. Shawn Shen Developer Advocate Google TV Google+:

Introducing the Adafruit Bluefruit LE Sniffer

Introduction to Android Development. Jeff Avery CS349, Mar 2013

WEARIT DEVELOPER DOCUMENTATION 0.2 preliminary release July 20 th, 2013

4 Application Development

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Context-Awareness and Location-based Services

International Journal of Advanced Research in Computer Science and Software Engineering

Android Services. Android. Victor Matos

Module Title: Software Development A: Mobile Application Development

Sensors & Motion Sensors in Android platform. Minh H Dang CS286 Spring 2013

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Introducing BEEKS Proximity Solutions. Developer Kit Gets You Started

Mobila applikationer och trådlösa nät

Horizontal IoT Application Development using Semantic Web Technologies

ExpoBadge Mobile App User Guide

Iotivity Programmer s Guide Soft Sensor Manager for Android

Design and Implementation of In-house Mobile Electronic Cash in Universities

Programming with Android

Transcription:

Location and Sensors

Masumi Nakamura

Location Manifest android.permission.access_coarse_location android.permission.access_fine_location Package android.location.* LOCATION_SERVICE (LocationManager) context.getsystemservice(context.location_service);

LocationManager LocationListener LocationListener Interface onlocationchanged(location location);

LocationManager - Usage requestlocationupdates (criteria, time, dist, listener) Criteria LocationManager.GPS_PROVIDER LocationManager.NETWORK_PROVIDER LocationManager.PASSIVE_PROVIDER removeupdates(listener); getlastknownlocation(provider)

Tips http://android-developers.blogspot.com/2011/06/deep-dive-into-lo cation.html (Reto Meier) http://code.google.com/p/android-protips-location/ getlastknownlocation() Coarse to Fine Intent usage (PendingIntent) to get latest update Passive Location Provider Prefetch Monitor Battery (Be Smart)

Location Lat / Lon Location.distanceBetween / distanceto GeoCoder getfromlocation getfromlocationname

Google Maps Android API Google Play Services API isgoogleplayservicesavailable() Manifest <uses-library android:name="com.google.android.maps" /> Package com.google.android.maps.* MapActivity / MapView MyLocationOverlay

MapActivity / MapView 1

MapActivity / MapView 2

MapActivity / MapView 3 MyLocationOverlay

OverlaySample

Sensors TYPE_ALL TYPE_ACCELEROMETER TYPE_GYROSCOPE TYPE_GRAVITY TYPE_ROTATION_VECTOR TYPE_LINEAR_ACCELERATION TYPE_MAGNETIC_FIELD TYPE_LIGHT TYPE_PROXIMITY TYPE_RELATIVE_HUMIDITY TYPE_AMBIENT_TEMPERATURE

Sensors - SensorListener SensorListener onaccuracychanged() onsensorchanged() registerlistener(listener, sensor, delay) SENSOR_DELAY_NORMAL SENSOR_DELAY_UI SENSOR_DELAY_GAME SENSOR_DELAY_FASTEST unregisterlistener

Sensors Orientation Events SensorEvent float[] values timestamp

NFC

NFC Near Field Communication (NFC) Short-range (up to 20 cm) http://www.nfc-forum.org/ (spec) 3 Modes: Card Emulation (readable) Reader Mode (reading) P2P Mode (data exchange)

NdefMessage (NDEF Message) NDEF - NFC Data Exchange Format 1 NDEF Message per NFC Scan Contains 1 or more NDEF Records android.nfc.ndefmessage Is a Parcelable (Intent passable)

NdefRecord (NDEF Record) android.nfc.ndefrecord May contain mutable fields Structure: 3-bit TNF (Type Name Format) Variable length type (when TNF_WELL_KNOWN) Variable length ID (optional ID) Variable length payload

Manifest <uses-permission android:name="android.permission.nfc"/> <uses-feature android:name="android.hardware.nfc" android:required="true" /> <uses-sdk android:minsdkversion="10"/> SDK 9 (2.3) ACTION_TAG_DISCOVERED only SDK 10 (2.3.3) Writing capability enabled SDK 14 (4.0) - Beam

NfcAdapter NfcAdapter adapter = NfcAdapter.getDefaultAdapter(context); if(adapter!=null) { } // true if enabled, false if not boolean enabled=adapter.isenabled();

enableforegrounddispatch

ACTION_NDEF_DISCOVERED

TECH_DISCOVERED

ACTION_TAG_DISCOVERED

Reading the Tag byte[] id=intent.getbytearrayextra(nfcadapter.extra_id); Tag tag = (Tag)intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); // API 10+ Parcelable[] msgs= intent.getparcelablearrayextra(nfcadapter.extra_ndef_messa GES); // msgs are NdefMessage so recast is needed

NdefRecord.RTD_TEXT

NdefRecord.RTD_URI First Byte defines prefix of URI

Sample TextRecord

Writing to Tag TagTechnology Ndef ndefref = Ndef.get((Tag)intent.getParcelableExtra(NfcAdapter.EXTRA_TAG)); ndefref.writendefmessage(msgtowrite); connect() must be called before I/O operation. I/O operations may block so do not call in main app thread Only one TagTechnology can be connected at a time close() must be called after completing I/O

P2P Mode and Beam P2P mode API 10 (2.3.3) enableforegroundndefpush() enableforegrounddispatch() Beam API 14+ (4.0+) setndefpushmessage() // sync setndefpushmessagecallback() // async

P2P Mode

Beam