Android Application Model I
|
|
- Theodore Ellis
- 5 years ago
- Views:
Transcription
1 Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath Reading: Big Nerd Ranch Guide, Chapters 3, 5 (Activities); Chapter 13 (menus) 1
2 Android Framework Support 2
3 Framework Capabilities and Add-Ons Built-In Services: GUI OS services (file I/O, threads, device management) Graphics Device access (GPS, camera, media players, sensors), Networking Standard language libraries Add-ons: Google Play services (e.g. Google Maps, Games, etc.) Database support (SQLite) WebKit/Chromium 3
4 Tooling Support IDE: Android Studio Testing tools: JUnit, Espresso Performance profiling tools: Android Profiler Source code management: Git, Subversion, CVS, etc. Software emulators: Android emulator, Intel HAXM, Genymotion Sensor injection via emulator 4
5 Android Studio Project Components 5
6 Types of Android Programs Applications Home app, Home screen Take over screen Services Run in the background without UI App widgets and home screen widgets View-only interface to a service Home screen widget if on Home screen All apps have Activities a key part of any Android app 6
7 Activities in Tic-Tac-Toe 7
8 Specifying Activities AndroidManifest.xml <activity android:name=".splashscreen" android:screenorientation="portrait"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="android.intent.category.launcher /> </intent-filter> </activity> <activity android:name=".login" android:launchmode="singleinstance" android:screenorientation="portrait"> <intent-filter> <action android:name="com.wiley.fordummies.androidsdk.login"/> <category android:name="android.intent.category.default"/> </intent-filter> </activity> 8
9 Implementing Activities Java public class LoginActivity extends SingleFragmentActivity { public class GameSessionActivity extends SingleFragmentActivity { Kotlin class LoginActivity : SingleFragmentActivity() { class GameSessionActivity : SingleFragmentActivity() { Note: SingleFragmentActivity extends FragmentActivity
10 Activity UI Widgets View and ViewGroup Package android.view Specified declaratively in layout files Always use Fragments 10
11 Sample Layout: Login Activity <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android=" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="20dip"> <LinearLayout android:orientation="vertical <TextView /> <TextView /> <EditText /> <TextView /> <EditText /> <Button /> <Button /> <Button /> </LinearLayout> </ScrollView> 11 <project>/app/src/main/res/layout/fragment_login.xml
12 Views, ViewGroups, Layouts, Widgets Many types of views, layouts and widgets: ScrollView, HorizontalScrollView LinearLayout, AbsoluteLayout, FrameLayout, RelativeLayout TextView, EditText, Button, DatePicker, Spinner Nested nature of layout ViewGroup base class for composite elements View base class for terminal UI components Layout files compiled into resource R class in res subtree 12
13 Implement UI Logic: Listener Objects: Java public class LoginActivity extends SingleFragmentActivity { // Create LoginFragment in oncreate() method. (See SingleFragmentActivity) public class LoginFragment extends Fragment implements View.OnClickListener { private EditText musernameedittext; private EditText public View oncreateview() { // The real code has many null checks and screen rotation check (omitted for brevity) View v = inflater.inflate(r.layout.fragment_login, container, false); musernameedittext = v.findviewbyid(r.id.username_text); mpasswordedittext = v.findviewbyid(r.id.password_text); Button loginbutton = v.findviewbyid(r.id.login_button); loginbutton.setonclicklistener(this); Button cancelbutton = v.findviewbyid(r.id.cancel_button); cancelbutton.setonclicklistener(this); Button newuserbutton = v.findviewbyid(r.id.new_user_button); newuserbutton.setonclicklistener(this); return v; 13
14 Implement UI Logic: Listener Objects: Kotlin class LoginActivity : SingleFragmentActivity() { // Create LoginFragment in oncreate() method. (See SingleFragmentActivity) class LoginFragment : Fragment(), View.OnClickListener { private lateinit var musernameedittext: EditText private lateinit var mpasswordedittext: EditText override fun oncreateview( ): View? { // Similarly, real code has screen rotation check (omitted for brevity) val v = inflater.inflate(r.layout.fragment_login, container, false) musernameedittext = v.findviewbyid(r.id.username_text) mpasswordedittext = v.findviewbyid (R.id.password_text) val loginbutton = v.findviewbyid(r.id.login_button) loginbutton.setonclicklistener(this) val cancelbutton = v.findviewbyid(r.id.cancel_button) cancelbutton.setonclicklistener(this) val newuserbutton = v.findviewbyid(r.id.new_user_button) newuserbutton.setonclicklistener(this) return v // 14
15 The OnClick Handler Java public void onclick(view v) { switch (v.getid()) { case R.id.login_button: checklogin(); break; case R.id.cancel_button: finish(); break; case R.id.new_user_button: FragmentManager fm = getfragmentmanager(); Fragment fragment = new AccountFragment(); fm.begintransaction().replace(/* container */, fragment).addtobackstack("account_fragment").commit(); break; // Null check code omitted Kotlin override fun onclick(view: View) { when (view.id) { R.id.login_button -> checklogin() R.id.cancel_button -> activity?.finish() R.id.new_user_button -> val fm = fragmentmanager fm?.begintransaction()?.replace(/* container */, fragment)?.addtobackstack()?.commit() Kotlin s?. operator is short for: if (object!= null) { object.callmethod() 15
16 Embedding a View: GameSession Activity, Fragment: Java public class GameSessionActivity extends SingleFragmentActivity { public class GameSessionFragment extends Fragment { <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" > <LinearLayout... <com.wiley.fordummies.androidsdk.board android:id="@+id/board" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </LinearLayout> <TextView... "/> <TextView... "/> </LinearLayout> 16
17 Embedding a View: GameSession Activity, Fragment: Kotlin class GameSessionActivity : SingleFragmentActivity() { class GameSessionFragment : Fragment() { <!-- Same XML as before --> 17
18 Embedding a View: Board Class Java // Board.java public class Board extends View {... public boolean ontouchevent( MotionEvent event) { switch (action) { case MotionEvent.ACTION_DOWN: break; return super.ontouchevent(event); Kotlin // Board.kt class Board : View { override fun ontouchevent( event: MotionEvent): Boolean { when (action) { MotionEvent.ACTION_DOWN -> { return super.ontouchevent(event) 18
19 Handling UI in the Activity Activity also a View Can handle UI without any widgets. Why? Handle non-widget-specific events (touch) Handle user interaction outside the boundaries of any UI components See ontouchevent method in SplashScreenFragment class. 19
20 Menus (Option menus) and Action Bars Declare the menu items Define oncreateoptionsmenu() and/or the oncreatecontextmenu() callback methods in Activity. Automatically called to create the menu (what if it doesn t exist?). Implement onoptionsitemselected() and/or oncontextitemselected() in activity. 20
21 Menu Layout File <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android=" <item android:title="settings" /> <item android:title="help" /> <item android:title="exit" /> <item android:title="contacts" /> </menu> Action Bar: Declare menu item with additional attribute 21 android:showasaction ="ifroom","never","withtext" or "always".
22 Menu Creation: Java public class GameOptionsFragment {... public View oncreateview( ) { // sethasoptionsmenu(true);... public boolean oncreateoptionsmenu(menu menu) { super.oncreateoptionsmenu(menu, inflater); inflater.inflate(r.menu.menu, menu);... 22
23 Menu Creation: Kotlin class GameOptionsFragment { override fun oncreateview( ) { // sethasoptionsmenu(true); override fun oncreateoptionsmenu( menu: Menu, inflater: MenuInflater) { super.oncreateoptionsmenu(menu, inflater) inflater.inflate(r.menu.menu_ingame, menu) 23
24 Menu Handlers: Java public boolean onoptionsitemselected(menuitem item) { Activity activity = getactivity(); if (activity!= null) { switch (item.getitemid()) { case R.id.menu_settings: startactivity(new Intent(activity, SettingsActivity.class)); return true; case R.id.menu_help: startactivity(new Intent(activity, HelpActivity.class)); return true; case R.id.menu_exit: showquitappdialog(); return true; case R.id.menu_contacts: startactivity(new Intent(activity, return false; ContactsActivity.class)); return true; 24
25 Menu Handlers: Kotlin override fun onoptionsitemselected(item: MenuItem?): Boolean { when (item!!.itemid) { R.id.menu_settings -> { startactivity(intent(activity?.applicationcontext, SettingsActivity::class.java)) return true R.id.menu_help -> { startactivity(intent(activity?.applicationcontext, HelpActivity::class.java)) return true R.id.menu_exit -> { showquitappdialog() return true R.id.menu_contacts -> { startactivity(intent(activity?.applicationcontext, ContactsActivity::class.java)) return true Kotlin s!! operator asserts that return false calling object is not null 25
26 UI for Larger Screens - Fragments In Android 3.0 and up with compatibility library (ACL) for earlier versions Further decouples UI interactions from activity lifecycle Standard concept in frameworks Allows reuse of UI components Specialized activity class FragmentActivity We will cover it in a later class 26
27 Special Types of Activities: Preferences: Java public class SettingsActivity extends AppCompatActivity { protected Fragment createfragment() { return new protected void oncreate(bundle savedinstancestate) { FragmentManager fm = getsupportfragmentmanager(); Fragment fragment = fm.findfragmentbyid(r.id.fragment_container); Fragment preferencefragment = createfragment(); fm.begintransaction().replace(r.id.fragment_container, preferencefragment).commit(); PreferenceManager.setDefaultValues(this, R.xml.settings, false); public class SettingsFragment extends PreferenceFragmentCompat public void oncreatepreferences(bundle savedinstancestate, String rootkey) { // Load preferences from XML resource. addpreferencesfromresource(r.xml.settings); 27
28 Special Types of Activities: Preferences: Kotlin class SettingsActivity : AppCompatActivity() { protected fun createfragment(): Fragment { return SettingsFragment() override fun oncreate(savedinstancestate: Bundle?) { val fm = supportfragmentmanager val fragment = fm.findfragmentbyid(r.id.fragment_container) val preferencefragment = createfragment() fm.begintransaction().replace(r.id.fragment_container, preferencefragment).commit() PreferenceManager.setDefaultValues(this, R.xml.settings, false) class SettingsFragment : PreferenceFragmentCompat() { override fun oncreatepreferences(savedinstancestate: Bundle?, rootkey: String?) { // Load preferences from XML resource. addpreferencesfromresource(r.xml.settings) 28
29 Layout File for a Preferences Activity <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android= android:title="settings" android:background="@color/background"> <EditTextPreference android:key="name" android:title="player Info" android:summary="select your name" android:defaultvalue="player 1"/> <CheckBoxPreference android:key="human_starts" android:title="human Plays First" android:summary="check box to play first" android:defaultvalue="true" /> </PreferenceScreen> 29
30 Settings Java // Settings.java public class Settings { public static String getname( Context context) { return PreferenceManager.getDefaultSharedPreferences(context).getString(OPT_NAME, OPT_NAME_DEF); public static boolean doeshumanplayfirst( Context context) { return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(OPT_PLAY_FIRST, OPT_PLAY_FIRST_DEF); Kotlin // Settings.kt object Settings { fun getname(context: Context): String { return PreferenceManager.getDefaultSharedPreferences(context).getString(OPT_NAME, OPT_NAME_DEF) fun doeshumanplayfirst(context: Context): Boolean { return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(OPT_PLAY_FIRST, OPT_PLAY_FIRST_DEF) 30
31 Thank You Questions and comments? 31
Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr.
Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath 1 Framework Support (e.g. Android) 2 Framework Capabilities
More informationUser Interface Development. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr.
User Interface Development CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr. Rajiv Ramnath 1 Outline UI Support in Android Fragments 2 UI Support in the Android
More informationExternal 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 informationMobile Application Development MyRent Settings
Mobile Application Development MyRent Settings Waterford Institute of Technology October 13, 2016 John Fitzgerald Waterford Institute of Technology, Mobile Application Development MyRent Settings 1/19
More informationMultiple devices. Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers
Multiple devices Multiple devices Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers Create a new directory in your project's res/ and name it using the
More informationMobila applikationer och trådlösa nät, HI1033, HT2013
Mobila applikationer och trådlösa nät, HI1033, HT2013 Today: - User Interface basics - View components - Event driven applications and callbacks - Menu and Context Menu - ListView and Adapters - Android
More informationAction 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 informationCS371m - Mobile Computing. More UI Action Bar, Navigation, and Fragments
CS371m - Mobile Computing More UI Action Bar, Navigation, and Fragments ACTION BAR 2 Options Menu and Action Bar prior to Android 3.0 / API level 11 Android devices required a dedicated menu button Pressing
More informationCS371m - Mobile Computing. More UI Navigation, Fragments, and App / Action Bars
CS371m - Mobile Computing More UI Navigation, Fragments, and App / Action Bars EFFECTIVE ANDROID NAVIGATION 2 Clicker Question Have you heard of the terms Back and Up in the context of Android Navigation?
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 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 informationMobile Computing Fragments
Fragments APM@FEUP 1 Fragments (1) Activities are used to define a full screen interface and its functionality That s right for small screen devices (smartphones) In bigger devices we can have more interface
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 informationMobila applikationer och trådlösa nät, HI1033, HT2012
Mobila applikationer och trådlösa nät, HI1033, HT2012 Today: - User Interface basics - View components - Event driven applications and callbacks - Menu and Context Menu - ListView and Adapters - Android
More informationCS 4330/5390: Mobile Application Development Exam 1
1 Spring 2017 (Thursday, March 9) Name: CS 4330/5390: Mobile Application Development Exam 1 This test has 8 questions and pages numbered 1 through 7. Reminders This test is closed-notes and closed-book.
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 with Android: Android for Tablets. Dipartimento di Scienze dell Informazione Università di Bologna
Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna Outline Android for Tablets: A Case Study Android for Tablets:
More informationComputer Science Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 26, 2017
Computer Science Large Practical: Storage, Settings and Layouts Stephen Gilmore School of Informatics October 26, 2017 Contents 1. Storing information 2. Kotlin compilation 3. Settings 4. Layouts 1 Storing
More informationAgenda. The Android GUI Framework Introduction Anatomy A real word example Life cycle Findings
The Android GUI Framework Java User Group Switzerland May 2008 Markus Pilz mp@greenliff.com Peter Wlodarczak pw@greenliff.com Agenda 1. 1. Introduction 2. 2. Anatomy 3. 3. A real word example 4. 4. Life
More informationEMBEDDED SYSTEMS PROGRAMMING UI and Android
EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI and Android STANDARD GESTURES (1/2) UI classes inheriting from View allow to set listeners that respond to basic gestures. Listeners are defined by suitable interfaces.
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 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 informationActivities and Fragments
Activities and Fragments 21 November 2017 Lecture 5 21 Nov 2017 SE 435: Development in the Android Environment 1 Topics for Today Activities UI Design and handlers Fragments Source: developer.android.com
More informationMobile and Ubiquitous Computing: Android Programming (part 3)
Mobile and Ubiquitous Computing: Android Programming (part 3) Master studies, Winter 2015/2016 Dr Veljko Pejović Veljko.Pejovic@fri.uni-lj.si Based on Programming Handheld Systems, Adam Porter, University
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 information07. Menu and Dialog Box. DKU-MUST Mobile ICT Education Center
07. Menu and Dialog Box DKU-MUST Mobile ICT Education Center Goal Learn how to create and use the Menu. Learn how to use Toast. Learn how to use the dialog box. Page 2 1. Menu Menu Overview Menu provides
More informationAndroid 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 informationProgramming Android UI. J. Serrat Software Design December 2017
Programming Android UI J. Serrat Software Design December 2017 Preliminaries : Goals Introduce basic programming Android concepts Examine code for some simple examples Limited to those relevant for the
More informationUI-Testing, Reactive Programming and some Kotlin.
UI-Testing, Reactive Programming and some Kotlin anders.froberg@liu.se Load up your guns, and bring your friends This is the end, My only Friend, the end Äntligen stod prästen i predikstolen I ll be back
More informationListView Containers. Resources. Creating a ListView
ListView Containers Resources https://developer.android.com/guide/topics/ui/layout/listview.html https://developer.android.com/reference/android/widget/listview.html Creating a ListView A ListView is a
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 informationOverview. What are layouts Creating and using layouts Common layouts and examples Layout parameters Types of views Event listeners
Layouts and Views http://developer.android.com/guide/topics/ui/declaring-layout.html http://developer.android.com/reference/android/view/view.html Repo: https://github.com/karlmorris/viewsandlayouts Overview
More informationCS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu
CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu Fragments Recall: Fragments Sub-components of an Activity (screen) An activity can contain multiple fragments, organized
More informationMobile Programming Lecture 7. Dialogs, Menus, and SharedPreferences
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences Agenda Dialogs Menus SharedPreferences Android Application Components 1. Activity 2. Broadcast Receiver 3. Content Provider 4. Service
More informationAndroid. Applications Activities Interface
Android Applications Activities Interface Applications Processes Usually each application, including all its components, runs in a single process; the Application object is always in memory Priorities
More informationANDROID USER INTERFACE
1 ANDROID USER INTERFACE Views FUNDAMENTAL UI DESIGN Visual interface element (controls or widgets) ViewGroup Contains multiple widgets. Layouts inherit the ViewGroup class Activities Screen being displayed
More informationAndroid. Applications Activities Interface. Applications. Processes. Priorities. Activities
Android Applications Activities Interface Applications Processes Usually each application, including all its components, runs in a single process; the Application object is always in memory Priorities
More informationJava & Android. Java Fundamentals. Madis Pink 2016 Tartu
Java & Android Java Fundamentals Madis Pink 2016 Tartu 1 Agenda» Brief background intro to Android» Android app basics:» Activities & Intents» Resources» GUI» Tools 2 Android» A Linux-based Operating System»
More informationUser 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 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 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 informationAction Bar. Action bar: Top navigation bar at each screen The action bar is split into four different functional areas that apply to most apps.
1 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. 1) App Icon 3) Action Buttons 2)View Control 4) Action Overflows
More informationMobile Development Lecture 10: Fragments
Mobile Development Lecture 10: Fragments Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com Situational Layouts Your app can use different layout in different situations: different device type
More informationAndroid CardView Tutorial
Android CardView Tutorial by Kapil - Wednesday, April 13, 2016 http://www.androidtutorialpoint.com/material-design/android-cardview-tutorial/ YouTube Video We have already discussed about RecyclerView
More informationAndroid Using Menus. Victor Matos Cleveland State University
Lesson 8 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 & Android Developers http://developer.android.com/index.html
More informationCS378 -Mobile Computing. More UI -Part 2
CS378 -Mobile Computing More UI -Part 2 Special Menus Two special application menus options menu context menu Options menu replaced by action bar (API 11) menu action bar 2 OptionsMenu User presses Menu
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 informationFragments. Lecture 10
Fragments Lecture 10 Situa2onal layouts Your app can use different layouts in different situa2ons Different device type (tablet vs. phone vs. watch) Different screen size Different orienta2on (portrait
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 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 informationEMBEDDED 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 informationMobile 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 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 informationAndroid Using Menus. Victor Matos Cleveland State University
8 Android 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 & Android Developers http://developer.android.com/index.html
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 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 informationUI Fragment.
UI Fragment 1 Contents Fragments Overviews Lifecycle of Fragments Creating Fragments Fragment Manager and Transactions Adding Fragment to Activity Fragment-to-Fragment Communication Fragment SubClasses
More informationEmbedded 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 informationHave a development environment in 256 or 255 Be familiar with the application lifecycle
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
More informationA Crash Course to Android Mobile Platform
Enterprise Application Development using J2EE Shmulik London Lecture #2 A Crash Course to Android Mobile Platform Enterprise Application Development Using J2EE / Shmulik London 2004 Interdisciplinary Center
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 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 informationBasic 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 informationSoftware Engineering Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 27, 2017
Software Engineering Large Practical: Storage, Settings and Layouts Stephen Gilmore School of Informatics October 27, 2017 Contents 1. Storing information 2. Settings 3. Layouts 1 Storing information Storage
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 informationProgramming with Android: Layouts, Widgets and Events. Dipartimento di Scienze dell Informazione Università di Bologna
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna Outline Components of an Activity ViewGroup: definition
More informationCS 4518 Mobile and Ubiquitous Computing Lecture 5: Rotating Device, Saving Data, Intents and Fragments Emmanuel Agu
CS 4518 Mobile and Ubiquitous Computing Lecture 5: Rotating Device, Saving Data, Intents and Fragments Emmanuel Agu Administrivia Moved back deadlines for projects 2, 3 and final project See updated schedule
More informationReal-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 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 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 informationFigure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard.
44 CHAPTER 2 Android s development environment Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard. TIP You ll want the package name of your applications to be unique
More informationSoftware Practice 3 Before we start Today s lecture Today s Task Team organization
1 Software Practice 3 Before we start Today s lecture Today s Task Team organization Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 Lecture Schedule Spring 2017 (Monday) This schedule can be changed M A R
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 informationAndroid UI: Overview
1 Android UI: Overview An Activity is the front end component and it can contain screens. Android screens are composed of components or screen containers and components within the containers Screen containers
More informationANDROID APPS DEVELOPMENT FOR MOBILE GAME
ANDROID APPS DEVELOPMENT FOR MOBILE GAME Application Components Hold the content of a message (E.g. convey a request for an activity to present an image) Lecture 2: Android Layout and Permission Present
More informationLearn 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 informationAndroid 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 informationFragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment
FRAGMENTS Fragments An activity is a container for views When you have a larger screen device than a phone like a tablet it can look too simple to use phone interface here. Fragments Mini-activities, each
More informationTabel mysql. Kode di PHP. Config.php. Service.php
Tabel mysql Kode di PHP Config.php Service.php Layout Kode di Main Activity package com.example.mini.webandroid; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity;
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 informationProduced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology
Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie User Interface Design" & Development -
More informationAndroid Basics. - Bhaumik Shukla Android Application STEALTH FLASH
Android Basics - Bhaumik Shukla Android Application Developer @ STEALTH FLASH Introduction to Android Android is a software stack for mobile devices that includes an operating system, middleware and key
More informationUI, Continued. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046
UI, Continued CS 2046 Mobile Application Development Fall 2010 Announcements Office hours have started HW1 is out, due Monday, 11/1, at 11:59 pm Clarifications on HW1: To move where the text appears in
More informationScreen Slides. The Android Studio wizard adds a TextView to the fragment1.xml layout file and the necessary code to Fragment1.java.
Screen Slides References https://developer.android.com/training/animation/screen-slide.html https://developer.android.com/guide/components/fragments.html Overview A fragment can be defined by a class and
More informationgetcount getitem getitemid getview com.taxi Class MainActivity drawerlayout drawerleft drawerright...
Contents com.taxi.ui Class CallDialog... 3 CallDialog... 4 show... 4 build... 5 com.taxi.custom Class CustomActivity... 5 TOUCH... 6 CustomActivity... 6 onoptionsitemselected... 6 onclick... 6 com.taxi.model
More informationBuilding User Interface for Android Mobile Applications II
Building User Interface for Android Mobile Applications II Mobile App Development 1 MVC 2 MVC 1 MVC 2 MVC Android redraw View invalidate Controller tap, key pressed update Model MVC MVC in Android View
More informationSimple Currency Converter
Simple Currency Converter Implementing a simple currency converter: USD Euro Colon (CR) Note. Naive implementation using the rates 1 Costa Rican Colon = 0.001736 U.S. dollars 1 Euro = 1.39900 U.S. dollars
More informationCSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.
CSE 660 Lab 7 Submitted by: Arumugam Thendramil Pavai 1)Simple Remote Calculator Server is created using ServerSocket class of java Server.java import java.io.ioexception; import java.net.serversocket;
More informationINTRODUCTION 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 informationAndroid Services. Victor Matos Cleveland State University. Services
22 Android Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html 22. Android Android A Service is an application component that runs in
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 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 informationACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi
ACTIVITY, FRAGMENT, NAVIGATION Roberto Beraldi Introduction An application is composed of at least one Activity GUI It is a software component that stays behind a GUI (screen) Activity It runs inside the
More informationMobile 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 informationMore Effective Layouts
More Effective Layouts In past weeks, we've looked at ways to make more effective use of the presented display (e.g. elastic layouts, and separate layouts for portrait and landscape), as well as autogenerating
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 informationGUI Design for Android Applications
GUI Design for Android Applications SE3A04 Tutorial Jason Jaskolka Department of Computing and Software Faculty of Engineering McMaster University Hamilton, Ontario, Canada jaskolj@mcmaster.ca November
More information8/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 informationStanislav Rost CSAIL, MIT
Session 2: Lifecycles, GUI Stanislav Rost CSAIL, MIT The Plan 1 Activity lifecycle Service lifecycle 2 Selected GUI elements UI Layouts 3 Hands on assignment: RoboChat Application GUI Design Birth, death,
More informationCS260 Intro to Java & Android 05.Android UI(Part I)
CS260 Intro to Java & Android 05.Android UI(Part I) Winter 2015 Winter 2015 CS250 - Intro to Java & Android 1 User Interface UIs in Android are built using View and ViewGroup objects A View is the base
More information