Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, 2015-2016 WEB:

Slides:



Advertisements
Similar presentations
Programming with Android: Application Resources Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Advertisements

CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Android User Interface
App Customization. Introduction  Not all Android apps look the same  i.e. the default bland black and white look  Most have custom looks like  Background.
Poster Print Size: This poster template is 20” high by 24” wide. It can be used to print any poster with a 3:4 aspect ratio. Placeholders: The various.
More Java: Encapsulation, Getters, Setters, Anonymous Class 1 CS300.
© 2009 Research In Motion Limited BlackBerry themes and animated graphics.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Programming with Android: Application Resources Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
2D Graphics: Part 2.
Chapter 10: Move! Creating Animation
Exploring 2D Graphics: The Sudoku Example Content taken from book: “Hello, Android” by Ed Burnette Third Edition.
Chapter 2: Simplify! The Android User Interface
Chapter 5 Creating User Interfaces GOALS and OBJECTIVES Begin our application by creating our user interface. More than one way to create a user interface.
Android Layouts. Layouts Define the user interface for an activity Layouts are defined in.xml files – within /res/layout folder – different layout can.
@2011 Mihail L. Sichitiu1 Android Introduction GUI Menu Many thanks to Jun Bum Lim for his help with this tutorial.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Using Android XML Resources.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Resources. Application Resources Resources are strings, images, and other pieces of application information that are stored and maintained (externalized)
Poster Print Size: This poster template is 36” high by 48” wide. It can be used to print any poster with a 3:4 aspect ratio. Placeholders: The various.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Silicon Valley Code Camp 2009 “Embellish Your Pictures” Build an Application for an Android Phone Jack Ha, Balwinder Kaur Oct 3, 2009 – 5:15PM Room CCL.
Android Graphics Library. Color Android colors are represented with four numbers, one each for alpha, red, green, and blue (ARGB). Each component can.
UI Design and Development +Roman Nurik +Nick Butcher.
Themes and Menus: The Sudoku Example Content taken from book: “Hello, Android” by Ed Burnette Third Edition.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
REPLACE THIS BOX WITH YOUR ORGANIZATION’S
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
MOBILE COMPUTING D10K-7D02 MC03: Introduction to Android Programming Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas.
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
HDFLook Some basic instructions on the functionality of the HDFLook software.
1 Mobile Computing Handling Different Display Sizes Copyright 2015 by Janson Industries.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Android Drawing Units and The.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Motion Graphics & Animation.
Template Provided By Genigraphics –
Lecture 2 agenda flip teaching install p4merge rename project packages review git review Android Studio (Vinny) layouts and resources java event model.
Android View Stuff. TextViews Display text Display images???
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
Lecture 8 the Preference Menu. Settings... Sudoku settings s Music Play background music Hints Show hints during play We add some strings to the strings.xml.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 10: Move! Creating Animation 1 Android.
Resources & Android Manifest Калин Кадиев Astea Solutions AD.
CHAPTER 5 Graphics Drawing Audio. Chapter objectives: Learn to draw to a canvas Examine the process of adding drawn elements and UI controls to a layout.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
School of Engineering and Information and Communication Technology KIT305/KIT607 Mobile Application Development Android OS –Permissions (cont.), Fragments,
Resources. Android Resources We’ve already talked about the different types of Android Resources DirectoryResource Type anim/XML files that define tween.
CHAPTER 1 Part 2 Android Programming. Chapter objectives: Understand how to create a simple Android project Understand how to create a manifest file Understand.
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
Chapter 2: Simplify! The Android User Interface
Mobile Applications (Android Programming)
Open Handset Alliance.
Mobile Software Development for Android - I397
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Flash Interface, Commands and Functions
2D Graphics: Part 2.
lec 07 Graphics Animations Location Services (GPS)
MAD.
Politeknik Elektronika Negeri Surabaya
Mobile Computing With Android ACST 4550 Android Resources
Mobile Computing With Android ACST 4550 Intro to Android, Part 3
CMPE419 Mobile Application Development
Android Project Structure, App Resources and Event Handling
Mobile Programmming Dr. Mohsin Ali Memon.
Presentation transcript:

Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, WEB: SKYPE: AKAVER 1

Android - Resources  All in some /res subdirectory ./anim – Animations ./color – Colors and Color State lists ./drawable – Picures (binary and xml) ./layout – Layouts ./menu – Menus ./mipmap – launcher icons only ./raw – Misc files (audio, video, etc) ./values – texts, sizes, styles ./xml – xml files  … 2

Android – Resources - Animation  Property animation  Modify objects property values over a time with an Animator  View animation  Tween animation – series on transformations on single image with Animation  Frame animation – sequence of images with AnimationDrawable 3

Android – Resources - Color  File location res/color/filename.xml  Resource reference R.color.filename  Android:color  The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats:  #RGB  #ARGB  #RRGGBB  #AARRGGBB 4 selectoritem

Android – Resources - Color 5 res/color/button_text.xml

Android – Resources - Drawable  Graphics that can be drawn  Retrieve with APIs such as getDrawable(…)  Apply to other XML using android:drawable and android:icon  BitmapDrawable –.png,.jpg,.gif  NinePatchDrawable -.9.png – PNG with stretchable regions  Layer List – array of other Drawables. Drawn in order, largest index on top  State List – differen bitmap graphics for different states (dif image when button is pressed)  Transition Drawable – can crossfade between two drawables  Inset, Clip, Scale, Shape…. 6

Android – Resources – Drawable Bitmap .png preferred,.jpg acceptable,.gif discouraged  File location /res/drawable/filename.png  XML bitmap – /res/drawable/filename.xml  Nine-patch  PNG image in which you can define stretchable regions  Usually background of a View that has at least one dimension set to "wrap_content" 7 bitmap

Android – Resources – configuration qualifiers  To ensure your resources look their best, you should include alternative versions for different screen possibilities. 8  ldpi (low)  mdpi (medium)  hdpi (high)  xhdpi extra-high)  xxhdpi (extra-extra-high)  xxxhdpi (extra-extra-extra-high)  nodpi (no scaling)  Folder name example:  res/layout-xlarge-land/my_layout.xml  port (portrait)  land (landscape)  long (long aspect ratio)  notlong (normal aspect ratio)  small, normal, large, xlarge (screen size)

Android – Resources – screen sizes and densities  Screen sizes and densities  xlarge screens are at least 960dp x 720dp  large screens are at least 640dp x 480dp  normal screens are at least 470dp x 320dp  small screens are at least 426dp x 320dp  ldpi (low) ~120dpi  mdpi (medium) ~160dpi  hdpi (high) ~240dpi  xhdpi (extra-high) ~320dpi  xxhdpi (extra-extra-high) ~480dpi  xxxhdpi (extra-extra-extra-high) ~640dpi 9

Android – Resources – Layer list  Array of other drawables  Last drawable in top  /res/drawable/filename.xml 10

Android – Resources – State list  Different images to represent the same graphic, depending on the state of the object  /res/drawable/filename.xml 11 selectoritem

Android – Resources – Transition  Can cross-fade between the two drawable resources. 12 transitionitem ImageButton button = (ImageButton) findViewById(R.id.button); TransitionDrawable drawable = (TransitionDrawable) button.getDrawable(); drawable.startTransition(500);

Android – Resources – Menu  Options Menu, Context Menu, or submenu 13 menuitemgroupitem menuitem

Android – Resources – Menu 14 public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.example_menu, menu); return true; } public void onGroupItemClick(MenuItem item) { // One of the group items (using the onClick attribute) was clicked // The item parameter passed here indicates which item it is // All other menu item clicks are handled by onOptionsItemSelected() }onOptionsItemSelected()

Android – Resources – Values  Typed array  @drawable/logout Resources res = getResources(); TypedArray icons = res.obtainTypedArray(R.array.icons); Drawable drawable = icons.getDrawable(0);getResources()obtainTypedArraygetDrawable resource resourcesarrayitem

Android – Resources – Values  res/values/colors.xml  R.color.color_name  The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats:  #RGB  #ARGB  #RRGGBB  #AARRGGBB 16 hex_color resourcescolor #f00 #80ff0000 Resources res = getResources(); int color = res.getColor(R.color.opaque_red);getResources()getColor

Android – Resources – Values  Dimensions  res/values/filename.xml  R.dimen.dimension_name  dp - Density-independent Pixels  sp - Scale-independent Pixels ( scaled by the user's font size preference)  pt - Points - 1/72 of an inch based on the physical size of the screen.  px - Pixels - Corresponds to actual pixels on the screen.  mm - Millimeters - Based on the physical size of the screen  in - Inches - Based on the physical size of the screen. 17 dimension resourcesdimen 25dp 150dp 30dp 16sp Resources res = getResources(); float fontSize = res.getDimension(R.dimen.font_size);getResources()getDimension

Android – Resources – Values  String  res/values/filename.xml  R.string.string_name 18 text_string resourcesstring Hello! String string = getString(R.string.hello);getString

Android – Resources – Values  String array  res/values/filename.xml  R.array.string_array_name 19 text_string resourcesstring-arrayitem Mercury Venus Earth Mars Resources res = getResources(); String[] planets = res.getStringArray(R.array.planets_array);getResources()getStringArray

Android – Resources – Values  Quantity Strings (Plurals)  res/values/filename.xml  R.plurals.plural_name 20 text_string resourcespluralsitem %d song found. %d songs found. int count = getNumberOfsongsAvailable(); Resources res = getResources(); String songsFound = res.getQuantityString(R.plurals.numberOfSongsAvailable, count, count);getResources()getQuantityString

Android – Resources – Style  Style resource defines the format and look for a UI.  res/values/filename.xml 21 style_value resourcesstyleitem 20sp #008