ELET4133: Embedded Systems. Topic 15 Sensors
|
|
- Tracey Ramsey
- 6 years ago
- Views:
Transcription
1 ELET4133: Embedded Systems Topic 15 Sensors
2 Agenda What is a sensor? Different types of sensors Detecting sensors Example application of the accelerometer 2
3 What is a sensor? Piece of hardware that collects data from the physical world, transforms it into useable data and transfers it to the computer or microcontroller Apps read the data (as voltage or current), Makes a decision based on its value Does whatever it needs to do Sensors operate as input devices only To receive data we have to setup a listener to react to new incoming data 3
4 Sensor Types Light Sensor As of Android 2.3 Proximity Sensor Gravity Sensor Temperature Sensor Linear Accerlation Sensor Pressure Sensor Rotation Vector Sensor Gyroscope Sensor Near Field Accelerometer Commincation (NFC) Magnetic Field Sensor Sensor Orientation Sensor Works differently than the others 4
5 Detecting a Sensor Not all devices have all sensors The emulator has only an accelerometer Basically for orientation purposes To discover which sensors are on your device you can use a direct or indorect method Direct: get a list of available sensors from the SensorManager, set up listeners for them, then retrieve data from them Assumes user has already installed the App Indirect: in the manifest you can specify the resoruces a device must have to use this App 5
6 Develop an App to List Sensors The App should look like this: It will use a simple Linear Layout, but have a ScrollView Then a TextView within the ScrollView In case there is a long list of sensors 6
7 Start with the Layout Setup a TextView within a Scroll View within a Linear Layout Try it graphically: First: changed the default layout (Relative) to a Vertical Linear Layout 7
8 Start with the Layout Setup a TextView within a Scroll View within a Linear Layout Try it graphically: First: changed the default layout (Relative) to a Vertical Linear Layout Then: Select a Scroll View from the Composite Pallete 8
9 Start with the Layout Setup a TextView within a Scroll View within a Linear Layout Try it graphically: First: changed the default layout (Relative) to a Vertical Linear Layout Then: Select a Scroll View from the Composite Pallete and drag it over to the graphical layout screen 9
10 Start with the Layout As you drag it into the Linear Layout, it will turn orange 10
11 Start with the Layout As you drag it into the Linear Layout, it will turn orange When you drop it, it will turn blue. 11
12 Start with the Layout As you drag it into the Linear Layout, it will turn orange When you drop it, it will turn blue. Then if you pull it down and let go, the scrollview will expand to fill the screen. 12
13 Start with the Layout As you drag it into the Linear Layout, it will turn orange When you drop it, it will turn blue. Then if you pull it down and let go, the scrollview will expand to fill the screen. Then drop in the textview 13
14 Start with the Layout As you drag it into the Linear Layout, it will turn orange When you drop it, it will turn blue. Then if you pull it down and let go, the scrollview will expand to fill the screen. Then drop in the textview The xml file appears as shown here 14
15 Start with the Layout As you drag it into the Linear Layout, it will turn orange When you drop it, it will turn blue. Then if you pull it down and let go, the scrollview will expand to fill the screen. Then drop in the textview The warning message states that either the LinearLayout or the ScrollView are unecessary The xml file appears as shown here 15
16 Start with the Layout But, it was left the way it was because it didn t hurt anything and it was just a warning 16
17 Add Functionality 17
18 Start the Java File This is the Java file that has (so far) been generated by Eclipse 18
19 Add the TextView This is the Java file that has (so far) been generated by Eclipse TextView mytextview = (TextView)findViewById(R.id.textView1); This statement was added to create an identifier and a reference for the TextView. When this statement was first typed in, an error was generated, but there was nothing wrong that I could see. 19
20 Add the TextView This is the Java file that has (so far) been generated by Eclipse TextView mytextview = (TextView)findViewById(R.id.textView1); This statement was added to create an identifier and a reference for the TextView. When this statement was first typed So, [CNTRL][SHIFT]+O was typed, which added the correct import statement in, an error was generated, but there was nothing wrong that I so that the error was resolved could see. 20
21 Add the SensorManager Next, we need a reference to the Sensor Manager The command is: SensorManager sensormanager = (SensorManager) this.getsystemservice(sensor_service); There can be only one Sensor Manager, and so we need it for the system s sensor service. The command is inserted here. 21
22 Add the getsensorlist Command Now that we have a sensor manager, we can use the getsensorlist ( ) method It will return a list of all the sensors The command is: List<Sensor> sensors = sensormanager.getsensorlist(sensor.type_all); 22
23 Add the getsensorlist Command Now that we have a sensor manager, we can use the getsensorlist ( ) method It will return a list of all the sensors The command is: List<Sensor> sensors = sensormanager.getsensorlist(sensor.type_all); And, again, we have an error. [CNTRL][SHIFT]+O imports the correct package 23
24 Help Windows As the command is being typed, several Help screens pop up: 24
25 Help Windows The.getSensorList help 25
26 Help Windows The.getSensorList help and the Type Help (Type of List) 26
27 The Information Next, we need to build a String to hold the information that we want to display in the TextView: The list of sensors 27
28 The Information To do this, use a StringBuilder Allows you to append information to an existing String First, create a new StringBuilder Then append your starting message to it 28
29 The Information This command returns a list of all the sensors Then, we have to use some kind of loop to build the list of sensors 29
30 The Information Create a new Sensor called sensor 30
31 The Information Create a new Sensor called sensor As the sensor.getname statement is being typed, the help screen pops up so we can see what methods are available to sensor 31
32 The Information Create a new Sensor called sensor As the sensor.getname statement is being typed, the help screen pops up so we can see what methods are available to sensor 32
33 The Information An identifier name (sensortypes) was used, but it has no corresponding type So an error occurs This type has not been entered yet If you hover the cursor over the error, 9 quick fixes are suggested: 33
34 The Information An identifier name (sensortypes) was used, but it has no corresponding type So an error occurs This type has not been entered yet If you hover the cursor over the error, 9 quick fixes are suggested: 34
35 The Information But, to fix it, we are going to create a HashMap A HashMap is a subclass of Map that allows us to create a list of key and value pairs This will allow us to get a string for the Type of sensor in the list 35
36 The HashMap private HashMap<Integer, String> sensortypes = new HashMap<Integer, String>(); {// Initialize the map of sensor types and values sensortypes.put(sensor.type_accelerometer, "TYPE_ACCELEROMETER"); sensortypes.put(sensor.type_gyroscope, "TYPE_GYROSCOPE"); sensortypes.put(sensor.type_light, "TYPE_LIGHT"); sensortypes.put(sensor.type_magnetic_field, "TYPE_MAGNETIC_FIELD"); sensortypes.put(sensor.type_orientation, "TYPE_ORIENTATION"); sensortypes.put(sensor.type_pressure, "TYPE_PRESSURE"); sensortypes.put(sensor.type_proximity, "TYPE_PROXIMITY"); sensortypes.put(sensor.type_temperature, "TYPE_TEMPERATURE"); sensortypes.put(sensor.type_gravity, "TYPE_GRAVITY"); sensortypes.put(sensor.type_linear_acceleration, "TYPE_LINEAR_ACCELERATION"); sensortypes.put(sensor.type_rotation_vector, "TYPE_ROTATION_VECTOR"); } //End of Hash Map The HashMap matches an Integer constant (TYPE_LIGHT) to a String TYPE_LIGHT 36
37 The HashMap private HashMap<Integer, String> sensortypes = new HashMap<Integer, String>(); {// Initialize the map of sensor types and values sensortypes.put(sensor.type_accelerometer, "TYPE_ACCELEROMETER"); sensortypes.put(sensor.type_gyroscope, "TYPE_GYROSCOPE"); sensortypes.put(sensor.type_light, "TYPE_LIGHT"); sensortypes.put(sensor.type_magnetic_field, "TYPE_MAGNETIC_FIELD"); // sensortypes.put(sensor.type_orientation, "TYPE_ORIENTATION"); sensortypes.put(sensor.type_pressure, "TYPE_PRESSURE"); sensortypes.put(sensor.type_proximity, "TYPE_PROXIMITY"); // sensortypes.put(sensor.type_temperature, "TYPE_TEMPERATURE"); sensortypes.put(sensor.type_gravity, "TYPE_GRAVITY"); sensortypes.put(sensor.type_linear_acceleration, "TYPE_LINEAR_ACCELERATION"); sensortypes.put(sensor.type_rotation_vector, "TYPE_ROTATION_VECTOR"); } //End of Hash Map Two of the TYPES gave warning messages saying that they had been deprecated for this version of Android, so for now they were commented 37
38 One more thing We have to set the text into the TextView so that it will print the available sensors to the screen of the android 38
39 Execution The project was then tested on the emulator There are no sensors on the emulator, so all that was shown was the first string that was built 39
40 Execution The project was then tested on the emulator There are no sensors on the emulator, so all that was shown was the first string that was built Then, it was tested on the phone All of its sensors (that were found in that list) were printed on the screen 40
41 Accelerometer Test App 41
42 Accelerometer Test App This App will read the values on the Acceleromoter and print them on the screen If nothing else, it is a Test App to make usre that: There is an Accelerometer on the phone The Accelerometer is working The program will read the Acceleromoeter 42
43 Start with the Layout Again, we ll start with the Layout Keep it very simple The default RelativeLayout 43
44 Start with the Layout Again, we ll start with the Layout Keep it very simple The default RelativeLayout Add 4 TextViews to print the values for X, Y, and Z (and the title) 44
45 The Layout The default Relative Layout is: Has the single TextView for Hello World <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> 45
46 The TextViews The first part: The 1 st TextView is for the Title <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/relative"> <TextView android:textsize="30dp" android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content /> <TextView android:textsize="20dp" android:layout_below="@+id/name" android:id="@+id/xval" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
47 The TextViews The rest: </RelativeLayout> <TextView android:textsize="20dp" android:layout_width="fill_parent" android:layout_height="wrap_content" <TextView android:textsize="20dp" android:layout_width="fill_parent" android:layout_height="wrap_content" 47
48 The MainActivity.java We are going to use the Accelerometer, so we have several things we must do: 1. Extend Activity 2. Implement a SensorEventListener (for changes) 3. oncreate( ) method 4. Implement an event handler for when the accelerometer changes values 48
49 The MainActivity.java public class MainActivity extends Activity implements SensorEventListener { private SensorManager msensormanager; private Sensor maccelerometer; TextView title,tv,tv1,tv2; RelativeLayout layout; Create the necessary public final void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); msensormanager = (SensorManager) getsystemservice(context.sensor_service); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); //get layout layout = (RelativeLayout)findViewById(R.id.relative); } //get textviews title=(textview)findviewbyid(r.id.name); tv=(textview)findviewbyid(r.id.xval); tv1=(textview)findviewbyid(r.id.yval); tv2=(textview)findviewbyid(r.id.zval); 49
50 The MainActivity.java public class MainActivity extends Activity implements SensorEventListener { private SensorManager msensormanager; private Sensor maccelerometer; TextView title,tv,tv1,tv2; RelativeLayout layout; Setup the oncreate( ) public final void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); msensormanager = (SensorManager) getsystemservice(context.sensor_service); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); //get layout layout = (RelativeLayout)findViewById(R.id.relative); } //get textviews title=(textview)findviewbyid(r.id.name); tv=(textview)findviewbyid(r.id.xval); tv1=(textview)findviewbyid(r.id.yval); tv2=(textview)findviewbyid(r.id.zval); 50
51 The MainActivity.java public class MainActivity extends Activity implements SensorEventListener { private SensorManager msensormanager; private Sensor maccelerometer; TextView title,tv,tv1,tv2; RelativeLayout layout; Set the content public final void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); msensormanager = (SensorManager) getsystemservice(context.sensor_service); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); //get layout layout = (RelativeLayout)findViewById(R.id.relative); } //get textviews title=(textview)findviewbyid(r.id.name); tv=(textview)findviewbyid(r.id.xval); tv1=(textview)findviewbyid(r.id.yval); tv2=(textview)findviewbyid(r.id.zval); 51
52 The MainActivity.java public class MainActivity extends Activity implements SensorEventListener { private SensorManager msensormanager; private Sensor maccelerometer; TextView title,tv,tv1,tv2; RelativeLayout public final void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); msensormanager = (SensorManager) getsystemservice(context.sensor_service); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); //get layout layout = (RelativeLayout)findViewById(R.id.relative); Create a new SensorManager (always before the sensor) } //get textviews title=(textview)findviewbyid(r.id.name); tv=(textview)findviewbyid(r.id.xval); tv1=(textview)findviewbyid(r.id.yval); tv2=(textview)findviewbyid(r.id.zval); 52
53 The MainActivity.java public class MainActivity extends Activity implements SensorEventListener { private SensorManager msensormanager; private Sensor maccelerometer; TextView title,tv,tv1,tv2; RelativeLayout public final void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); msensormanager = (SensorManager) getsystemservice(context.sensor_service); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); //get layout layout = (RelativeLayout)findViewById(R.id.relative); Create a new accelerometer } //get textviews title=(textview)findviewbyid(r.id.name); tv=(textview)findviewbyid(r.id.xval); tv1=(textview)findviewbyid(r.id.yval); tv2=(textview)findviewbyid(r.id.zval); 53
54 The MainActivity.java public class MainActivity extends Activity implements SensorEventListener { private SensorManager msensormanager; private Sensor maccelerometer; TextView title,tv,tv1,tv2; RelativeLayout public final void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); msensormanager = (SensorManager) getsystemservice(context.sensor_service); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); //get layout layout = (RelativeLayout)findViewById(R.id.relative); } //get textviews title=(textview)findviewbyid(r.id.name); tv=(textview)findviewbyid(r.id.xval); tv1=(textview)findviewbyid(r.id.yval); tv2=(textview)findviewbyid(r.id.zval); Setup the needed textviews 54
55 The Event public final void onsensorchanged(sensorevent event) { // Many sensors return 3 values, one for each axis. float x = event.values[0]; float y = event.values[1]; float z = event.values[2]; The Event Handler declaration } //display values using TextView title.settext(r.string.app_name); tv.settext("x axis" +"\t\t"+x); tv1.settext("y axis" + "\t\t" +y); tv2.settext("z axis" +"\t\t" +z); 55
56 The Event public final void onsensorchanged(sensorevent event) { // Many sensors return 3 values, one for each axis. float x = event.values[0]; } float y = event.values[1]; float z = event.values[2]; //display values using TextView title.settext(r.string.app_name); tv.settext("x axis" +"\t\t"+x); tv1.settext("y axis" + "\t\t" +y); tv2.settext("z axis" +"\t\t" +z); The values for x, y, and z as read off the accelerometer 56
57 The Event public final void onsensorchanged(sensorevent event) { // Many sensors return 3 values, one for each axis. float x = event.values[0]; float y = event.values[1]; float z = event.values[2]; } //display values using TextView title.settext(r.string.app_name); tv.settext("x axis" +"\t\t"+x); tv1.settext("y axis" + "\t\t" +y); tv2.settext("z axis" +"\t\t" +z); Print out the title (AccelerometerDemo) 57
58 The Event public final void onsensorchanged(sensorevent event) { // Many sensors return 3 values, one for each axis. float x = event.values[0]; float y = event.values[1]; float z = event.values[2]; } //display values using TextView title.settext(r.string.app_name); tv.settext("x axis" +"\t\t"+x); tv1.settext("y axis" + "\t\t" +y); tv2.settext("z axis" +"\t\t" +z); Print out the three values) 58
59 Other protected void onresume() { super.onresume(); msensormanager.registerlistener(this, maccelerometer, SensorManager.SENSOR_DELAY_NORMAL); protected void onpause() { super.onpause(); msensormanager.unregisterlistener(this); } Two of the necessary methods In case the App is paused and resumed 59
60 Execution When executed on the emulator Again, nothing happens Must run it on the phone to test it 60
61 Summary We defined a sensor And looked at the different types of sensors on an android phone We wrote an App to detect the sensors on the phone and list them on the screen Developed an example application of the accelerometer 61
Xin Pan. CSCI Fall
Xin Pan CSCI5448 2011 Fall Outline Introduction of Android System Four primary application components AndroidManifest.xml Introduction of Android Sensor Framework Package Interface Classes Examples of
More informationAndroid Apps Development for Mobile Game Lesson 5
Workshop 1. Create a simple Environment Sensors (Page 1 6) Pressure Sensor Ambient Temperature Sensor Light Sensor Relative Humidity Sensor 2. Create a simple Position Sensors (Page 7 8) Proximity Sensor
More informationSensor & SensorManager SensorEvent & SensorEventListener Filtering sensor values Example applications
Sensor & SensorManager SensorEvent & SensorEventListener Filtering sensor values Example applications Hardware devices that measure the physical environment Motion Position Environment Motion - 3-axis
More informationTopics Related. SensorManager & Sensor SensorEvent & SensorEventListener Filtering Sensor Values Example applications
Sensors Lecture 23 Context-aware System a system is context-aware if it uses context to provide relevant information and/or services to the user, where relevancy depends on the user s task. adapt operations
More informationCE881: Mobile & Social Application Programming
CE881: Mobile & Social Application Programming Fragments and Jialin Liu Senior Research Officer Univerisity of Essex 13 Feb 2017 Today s App : Pocket (1/3) Today s App : Pocket (2/3) Today s App : Pocket
More informationEMBEDDED 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 informationAndroid 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 informationStatistics http://www.statista.com/topics/840/smartphones/ http://www.statista.com/topics/876/android/ http://www.statista.com/statistics/271774/share-of-android-platforms-on-mobile-devices-with-android-os/
More informationfilled by the user and display it by setting the value of view elements. Uses display.xml as layout file to display the result.
Project Description Form Activity: main activity which is presented to the user when launching the application for the first time. It displays a form and allows the user to fill and submit the form. When
More informationThreads. Marco Ronchetti Università degli Studi di Trento
1 Threads Marco Ronchetti Università degli Studi di Trento Threads When an application is launched, the system creates a thread of execution for the application, called "main or UI thread This thread dispatches
More informationSD Module-1 Android Dvelopment
SD Module-1 Android Dvelopment Experiment No: 05 1.1 Aim: Download Install and Configure Android Studio on Linux/windows platform. 1.2 Prerequisites: Microsoft Windows 10/8/7/Vista/2003 32 or 64 bit Java
More informationVienos 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 informationApplied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)
Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) In this exercise, we will create a simple Android application that uses IBM Bluemix Cloudant NoSQL DB. The application
More informationFragments. Lecture 11
Fragments Lecture 11 Situational layouts Your app can use different layouts in different situations Different device type (tablet vs. phone vs. watch) Different screen size Different orientation (portrait
More informationCreate 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 informationEMBEDDED 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 informationPENGEMBANGAN 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 informationIntents. 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 informationSpring Lecture 9 Lecturer: Omid Jafarinezhad
Mobile Programming Sharif University of Technology Spring 2016 - Lecture 9 Lecturer: Omid Jafarinezhad Sensors Overview Most Android-powered devices have built-in sensors that measure motion, orientation,
More informationSensors. Marco Ronchetti Università degli Studi di Trento
1 Sensors Marco Ronchetti Università degli Studi di Trento Sensor categories Motion sensors measure acceleration forces and rotational forces along three axes. This category includes accelerometers, gravity
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)
ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Lecture 3: Android Life Cycle and Permission Entire Lifetime An activity begins its lifecycle when entering the oncreate() state If not interrupted
More informationEMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches
EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI Specification: Approaches UIS: APPROACHES Programmatic approach: UI elements are created inside the application code Declarative approach: UI elements are listed
More informationMobile 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 informationTip Calculator. xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
Tip Calculator activity_main.xml
More informationAndroid Application Development. By : Shibaji Debnath
Android Application Development By : Shibaji Debnath About Me I have over 10 years experience in IT Industry. I have started my career as Java Software Developer. I worked in various multinational company.
More informationEMBEDDED 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 informationEMBEDDED 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 informationAPI Guide for Gesture Recognition Engine. Version 2.0
API Guide for Gesture Recognition Engine Version 2.0 Table of Contents Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket Library... 4 Project
More information1. 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 informationDatabase 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 informationExercise 1: First Android App
Exercise 1: First Android App Start a New Android Studio App Open Android Studio. Click on Start a new Android Studio project. For Application name enter First App. Keep other fields as default and click
More informationAndroid 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 informationMAD 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 informationANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)
ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Lecture 3: Android Life Cycle and Permission Android Lifecycle An activity begins its lifecycle when entering the oncreate() state If not
More informationMobile 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 informationAndroid - JSON Parser Tutorial
Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file
More informationSolving 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 informationApp Development for Smart Devices. Lec #8: Android Sensors
App Development for Smart Devices CS 495/595 - Fall 2011 Lec #8: Android Sensors Tamer Nadeem Dept. of Computer Science Some slides adapted from Stephen Intille Objective Android Sensors Sensor Manager
More informationTutorial: Setup for Android Development
Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Autumn 2017 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu
More informationMAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.
MAD ASSIGNMENT NO 2 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. Android Widgets There are given a lot of android widgets with simplified
More informationAdapters. Marco Ronchetti Università degli Studi di Trento
1 Adapters Marco Ronchetti Università degli Studi di Trento Adapter - AdapterView AdapterView: a view whose children are determined by an Adapter. Adapter: a bridge between an AdapterView and the underlying
More informationM.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126
M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 Submitted to: Sir Waqas Asghar MAY 23, 2017 SUBMITTED BY: REHAN ASGHAR Intent in Android What are Intent? An Intent is a messaging object you can use to request
More informationWorking with Sensors & Internet of Things
Working with Sensors & Internet of Things Mobile Application Development 2015/16 Fall 10/9/2015 Satish Srirama Mohan Liyanage liyanage@ut.ee Satish Srirama satish.srirama@ut.ee Mobile sensing More and
More informationAPI Guide for Gesture Recognition Engine. Version 1.1
API Guide for Gesture Recognition Engine Version 1.1 Table of Contents Table of Contents... 2 Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket
More informationCreate new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.
Hello World Lab Objectives: Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.xml What to Turn in: The lab evaluation
More informationLab 3. Accessing GSM Functions on an Android Smartphone
Lab 3 Accessing GSM Functions on an Android Smartphone 1 Lab Overview 1.1 Goals The objective of this practical exercise is to create an application for a smartphone with the Android mobile operating system,
More informationFragment Example Create the following files and test the application on emulator or device.
Fragment Example Create the following files and test the application on emulator or device. File: AndroidManifest.xml
More information<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 informationAndroid - Widgets Tutorial
Android - Widgets Tutorial A widget is a small gadget or control of your android application placed on the home screen. Widgets can be very handy as they allow you to put your favourite applications on
More informationCreate a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks.
CIS 470 Lesson 13 Databases - Quick Notes Create a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks. package csu.matos; import
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationAndroid Programs Day 5
Android Programs Day 5 //Android Program to demonstrate the working of Options Menu. 1. Create a New Project. 2. Write the necessary codes in the MainActivity.java to create OptionMenu. 3. Add the oncreateoptionsmenu()
More informationTextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.
A TextView displays text to the user. TextView Attributes TextView Control android:id - This is the ID which uniquely identifies the control. android:capitalize - If set, specifies that this TextView has
More informationBasic 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 informationGroup B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.
Group B: Assignment No 8 Regularity (2) Performance(5) Oral(3) Total (10) Dated Sign Title of Assignment: To verify the operating system name and version of Mobile devices. Problem Definition: Write a
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationComputer 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 informationEng. 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 informationMobile Health Sensing with Smart Phones
University of Arkansas, Fayetteville ScholarWorks@UARK Electrical Engineering Undergraduate Honors Theses Electrical Engineering 5-2015 Mobile Health Sensing with Smart Phones Abby Logan Wise University
More informationTutorial: Setup for Android Development
Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Spring 2018 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu
More informationComp 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 informationLifeStreet 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 informationAndroid UI Development
Android UI Development Android UI Studio Widget Layout Android UI 1 Building Applications A typical application will include: Activities - MainActivity as your entry point - Possibly other activities (corresponding
More informationChapter 5 Flashing Neon FrameLayout
5.1 Case Overview This case mainly introduced the usages of FrameLayout; we can use FrameLayout to realize the effect, the superposition of multiple widgets. This example is combined with Timer and Handler
More informationAdapter.
1 Adapter An Adapter object acts as a bridge between an AdapterView and the underlying data for that view The Adapter provides access to the data items The Adapter is also responsible for making a View
More informationAndroid Basics. Android UI Architecture. Android UI 1
Android Basics Android UI Architecture Android UI 1 Android Design Constraints Limited resources like memory, processing, battery à Android stops your app when not in use Primarily touch interaction à
More informationStarting 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 informationLab 5 Periodic Task Scheduling
Lab 5 Periodic Task Scheduling Scheduling a periodic task in Android is difficult as it goes against the philosophy of keeping an application active only while the user is interacting with it. You are
More informationMobile Software Development for Android - I397
1 Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, 2015-2016 EMAIL: AKAVER@ITCOLLEGE.EE WEB: HTTP://ENOS.ITCOLLEGE.EE/~AKAVER/2015-2016/DISTANCE/ANDROID SKYPE: AKAVER Timetable
More informationProgramming 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 informationAndroid Tutorial: Part 3
Android Tutorial: Part 3 Adding Client TCP/IP software to the Rapid Prototype GUI Project 5.2 1 Step 1: Copying the TCP/IP Client Source Code Quit Android Studio Copy the entire Android Studio project
More informationAndroid 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 informationUser Interface Development in Android Applications
ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture User Interface Development in Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan
More informationProduced by. Mobile Application Development. Eamonn de Leastar
Mobile Application Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie A First
More informationCSE 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 informationMeniu. 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 informationGetting 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 informationPROGRAMMING APPLICATIONS DECLARATIVE GUIS
PROGRAMMING APPLICATIONS DECLARATIVE GUIS DIVING RIGHT IN Eclipse? Plugin deprecated :-( Making a new project This keeps things simple or clone or clone or clone or clone or clone or clone Try it
More informationOur First Android Application
Mobile Application Development Lecture 04 Imran Ihsan Our First Android Application Even though the HelloWorld program is trivial in introduces a wealth of new ideas the framework, activities, manifest,
More informationUnderstand 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 informationTablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time
Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time The 1 activity 1 thing the user can do heuristic may not make sense for larger devices Application
More informationBy Ryan Hodson. Foreword by Daniel Jebaraj
1 By Ryan Hodson Foreword by Daniel Jebaraj 2 Copyright 2014 by Syncfusion Inc. 2501 Aerial Center Parkway Suite 200 Morrisville, NC 27560 USA All rights reserved. I mportant licensing information. Please
More informationUpon completion of the second part of the lab the students will have:
ETSN05, Fall 2017, Version 2.0 Software Development of Large Systems Lab 2 1. INTRODUCTION The goal of lab 2 is to introduce students to the basics of Android development and help them to create a starting
More informationChapter 8 Positioning with Layouts
Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 8 Positioning with Layouts Chapter 8 Overview Create user interfaces in Android by defining resource files or
More informationAndroid 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 informationMobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling
Mobile Programming Lecture 2 Layouts, Widgets, Toasts, and Event Handling Lecture 1 Review How to edit XML files in Android Studio? What holds all elements (Views) that appear to the user in an Activity?
More information05. 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 informationandroid: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 informationMobile 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 informationAn Overview of the Android Programming
ID2212 Network Programming with Java Lecture 14 An Overview of the Android Programming Hooman Peiro Sajjad KTH/ICT/SCS HT 2016 References http://developer.android.com/training/index.html Developing Android
More informationUNDERSTANDING 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 informationAgenda. 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 informationDiving 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 informationAPI Guide for Gesture Recognition Engine. Version 1.3
API Guide for Gesture Recognition Engine Version 1.3 Table of Contents Table of Contents...2 Gesture Recognition API...3 API URI... 3 Communication Protocol... 3 Getting Started...4 Protobuf... 4 WebSocket
More informationANDROID 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 informationCustom Views in Android Tutorial
Custom Views in Android Tutorial The Android platform provides an extensive range of user interface items that are sufficient for the needs of most apps. However, there may be occasions on which you feel
More informationEmbedded 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 informationJohnson Sun. Application / SASD
Johnson Sun Application / SASD August 2012 Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobilegt, PowerQUICC,
More informationSouth Africa
South Africa 2013 Lecture 6: Layouts, Menus, Views http://aiti.mit.edu Create an Android Virtual Device Click the AVD Icon: Window -> AVD Manager -> New Name & start the virtual device (this may take a
More information