Have a development environment in 256 or 255 Be familiar with the application lifecycle

Similar documents
Mobila applikationer och trådlösa nät, HI1033, HT2012

UNDERSTANDING ACTIVITIES

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

Upcoming Assignments Quiz today Web Ad due Monday, February 22 Lab 5 due Wednesday, February 24 Alpha Version due Friday, February 26

Introducing the Android Menu System

Mobila applikationer och trådlösa nät, HI1033, HT2013

Activities. Repo:

Overview of Activities

Meniu. Create a project:

CMSC436: Fall 2013 Week 3 Lab

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

Vienos veiklos būsena. Theory

Mobile Programming Lecture 7. Dialogs, Menus, and SharedPreferences

Embedded Systems Programming - PA8001

Android Activities. Akhilesh Tyagi

Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ]

Activities and Fragments

Lab 1: Getting Started With Android Programming

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

Real-Time Embedded Systems

Mobile User Interfaces

LECTURE NOTES OF APPLICATION ACTIVITIES

Android Programming Lecture 2 9/7/2011

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu

Android Using Menus. Victor Matos Cleveland State University

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

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

Software Engineering Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 27, 2017

Mobile Application Development MyRent Settings

Computer Science Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 26, 2017

CS378 -Mobile Computing. User Interface Basics

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment

Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time

Accelerating Information Technology Innovation

getcount getitem getitemid getview com.taxi Class MainActivity drawerlayout drawerleft drawerright...

Building MyFirstApp Android Application Step by Step. Sang Shin Learn with Passion!

Android Using Menus. Victor Matos Cleveland State University

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle

Android Programs Day 5

Lifecycle Callbacks and Intents

Lifecycle-Aware Components Live Data ViewModel Room Library

South Africa Version Control.

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

Starting Another Activity Preferences

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

CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu

Announcements. Android: n-puzzle Walkthrough. Tommy MacWilliam. Dynamic GUIs. ListViews. Bitmaps. Gameplay. Saving State. Menus

Programming Mobile Applications with Android Lab2

G1 Development Environment and Applica4on Development. Adam C. Champion CSE 788X11 Prof. Dong Xuan

CS 528 Mobile and Ubiquitous Computing Lecture 3: Android UI, WebView, Android Activity Lifecycle Emmanuel Agu

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

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters

EMBEDDED SYSTEMS PROGRAMMING Application Basics

Mobile Computing Fragments

Embedded Systems Programming - PA8001

How-to s and presentations. Be prepared to demo them in class. ons

Minds-on: Android. Session 2

05. RecyclerView and Styles

INTRODUCTION TO ANDROID

Computer Science E-76 Building Mobile Applications

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

Android Application Model I

States of Activities. Active Pause Stop Inactive

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop

Introduction to Android

Lab 1 - Setting up the User s Profile UI

UI, Continued. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046

Action Bar. Action bar: Top navigation bar at each screen The action bar is split into four different functional areas that apply to most apps.

Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr.

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

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

Multiple devices. Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Stanislav Rost CSAIL, MIT

Getting Started ArcGIS Runtime SDK for Android. Andy

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Q.1 Explain the dialog and also explain the Demonstrate working dialog in android.

University of Babylon - College of IT SW Dep. - Android Assist. Lect. Wadhah R. Baiee Activities

07. Menu and Dialog Box. DKU-MUST Mobile ICT Education Center

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

Android Fundamentals - Part 1

Android AND-401. Android Application Development. Download Full Version :

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.

MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING

shared objects monitors run() Runnable start()

14.1 Overview of Android

ACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi

CS 4518 Mobile and Ubiquitous Computing Lecture 5: Rotating Device, Saving Data, Intents and Fragments Emmanuel Agu

Application s Life Cycle

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015

Android Application Development

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Theme 2 Program Design. MVC and MVP

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing. Lab & Demo 2 (1 &2 of 3) Hello-Goodbye App Tutorial

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Saving application preferences

Transcription:

Upcoming Assignments Readings: Chapter 4 by today Horizontal Prototype due Friday, January 22 Quiz 2 today at 2:40pm Lab Quiz next Friday during lecture time (2:10-3pm) Have a development environment in 256 or 255 Be familiar with the application lifecycle Lab 2 due Wednesday, January 20 Lab 3 assigned today Monday holiday, Tuesday Furlough

Forming Teams Opportunity to improve communication and networking skills Essential skills for software engineers If you are still seeking a teammate, meet in 14-255 immediately after taking the quiz (around 2:55pm) Requests for larger teams will be entertained during lab today Let me know if you don t have at least one phone per team

Horizontal Prototype Purpose: Capture scope, functionality, flow through system Prototype the UI for all features/use cases All screens, controls, menus Capture the flow through the UI Dialog map Feature list Tools (must be digital): Images linked as web pages Balsamiq Review on 1/22 I will approve or ask for changes in scope

Application Lifecycle See flowchart in http://developer.android.com/guide/topics/fundament als.html See Figure 3-8 in text Active lifetime has focus, accepting UI events onresume to onpause Visible lifetime Visible, but does not have focus onstart to onstop Full lifetime oncreate to ondestroy

Campus Maps Active Lifetime Example Turn on/off GPS to save battery when UI not in focus protected void onpause() { super.onpause(); //stop receiving GPS and Orientation data locationmanager.removeupdates(locationlistener); protected void onresume() { super.onresume(); //restart receiving GPS and Orientation data locationmanager.requestlocationupdates(provider, 2000, 10, locationlistener);

Visible Lifetime Example Campus Maps Save state as app could get killed after onstop() protected void onstop() { super.onstop(); savepreferences(); protected void onstart() { super.onstart(); restoreuistate();

Visible Lifetime Example Campus Maps Save state as app could get killed after onstop() private void savepreferences() { SharedPreferences cmsharedpreferences = getsharedpreferences(cmprefs,activity.mode_private); SharedPreferences.Editor editor = cmsharedpreferences.edit(); editor.putboolean(virtual_mode, invirtualmode); editor.putint(map_index, curmapindex); editor.commit(); private void restoreuistate() { SharedPreferences cmsharedpreferences = getsharedpreferences(cmprefs,activity.mode_private); invirtualmode = cmsharedpreferences.getboolean(virtual_mode, true); curmapindex = cmsharedpreferences.getint(map_index, 0);

UI Elements View Control ViewGroup Layout Widget (Compound Control) Many expected Views Button, CheckBox, RadioButton TextView, EditText, ListView Can be customized by extending and overriding ondraw()

XML UI Configuration Layouts can specify UI elements (provided and custom) res/layout Lab 3 will explore this

Campus Maps Example See res/layout/main.xml public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main);

Custom View Example Campus Maps public class CampusMapView extends View { public void ondraw(canvas canvas) { super.ondraw(canvas); if (image!= null) { drawmapwithcircle(canvas); drawcompass(canvas); private void drawmapwithcircle(canvas canvas) { image.draw(canvas); // Paint paint = new Paint(); paint.setcolor(getresources().getcolor(r.color.mylocationouter)); canvas.drawcircle(circlex, circley, 10, paint); // ;

Menus Icon Menu (up to 6 icons) Expanded Menu (from More on Icon Menu) Submenus

Static Menu Example Campus Maps : oncreateoptionsmenu public boolean oncreateoptionsmenu(menu menu) { super.oncreateoptionsmenu(menu); //Help menu menu.add(0, MENU_HELP, Menu.NONE, R.string.menu_help); //Virtual toggle menu menu.add(0, MENU_VIRTUAL, Menu.NONE, R.string.menu_item_virtual_off); if (VERSION==VERSION_SINGLE) { return true; // do no more //Choose favorite menu SubMenu changemapmenu = menu.addsubmenu(0, MENU_CHANGE_MAP, Menu.NONE, R.string.menu_change_map); changemapmenu.add(0, MENU_CHANGE_0, 0, favcampusmaps[0].title); changemapmenu.add(0, MENU_CHANGE_1, 1, favcampusmaps[1].title); changemapmenu.add(0, MENU_CHANGE_2, 2, favcampusmaps[2].title); changemapmenu.add(0, MENU_CHANGE_3, 3, favcampusmaps[3].title);

Handle Menu Selection Campus Maps : onoptionsitemselected public boolean onoptionsitemselected(menuitem item) { super.onoptionsitemselected(item); switch (item.getitemid()) { case MENU_HELP: { Toast.makeText(CampusMapsActivity.this, "If you don't see a map, check your internet connectivity (mobile data or wifi).", Toast.LENGTH_LONG).show(); return true; case MENU_VIRTUAL: { if (VERSION == VERSION_TRIAL) { Toast.makeText(CampusMapsActivity.this, "Only virtual mode available in trial version.", Toast.LENGTH_LONG).show(); else { invirtualmode =!invirtualmode; //toggle setuplocationservice();

Dynamic Menu Example Campus Maps : onprepareoptionsmenu public boolean onprepareoptionsmenu(menu menu) { super.onprepareoptionsmenu(menu); MenuItem mi = null; mi = menu.finditem(menu_virtual); if (invirtualmode) mi.settitle(r.string.menu_item_virtual_off); else mi.settitle(r.string.menu_item_virtual_on); if (VERSION==VERSION_SINGLE) { return true; // do no more if (newmapadded) { menu.setgroupvisible(0, false); menu.setgroupvisible(1, true); else { menu.setgroupvisible(0, true);