Unit - 02 Working with other resources



Lesson Plan: Unit - 02
Subject: P15A2AAD - Android Application Development
Topic of Study: Working with others types of Resources
Grade/Level: Master of Computer Applications
Objective: To understand the mechanism of other resources for Android OS.
Time Allotment: 55 Minutes
  • Working with Boolean resources
    • Boolean resources can be used to store information about application game preferences and default values.
    • Boolean resources are defined in XML under the /res/values project directory.
    • Boolean values are appropriately tagged with the bool tag and represent a name-value pair.
    • Boolean resource file /res/values/bools.xml.
    • Exa. How to write a boolean resources in .xml
    • Exa. How to access in .java file
  • Working with Integer resources
    • You can also store integers as resources. 
    • Integer resources are defined in XML under the /res/values project directory.
    • Integer values are appropriately tagged with the integer tag and represent a name value pair.
    • Exa. How to write a integer resources in .xml
    • Exa. How to access in .java file
  • Working with color resources
    • Android applications can store RGB color values, which can then be applied to other screen elements.
    • Color resources are defined in XML under the /res/values project directory.
    • RGB color values always start with hash symbol (#).
    • Exa.
      • #RGB (#F00 is 12-bit color, red)
      • #ARGB (#8F00 is 12-bit color, red with alpha 50%)
      • #RRGGBB (#FF00FF is 24-bit color, magenta)
      • #AARRGGBB (#80FF00FF is 24-bit color, magenta with alpha 50%)
    • Exa. How to write a color resources in .xml
    • Exa. How to access in .java file
  • Working with Dimension resources
    • Many user interface layout controls such as text controls and buttons are drawn to specific dimensions.
    • These dimensions can be stored as resources. 
    • Dimension values always end with a unit of measurement tag.
    • Dimension values are appropriately tagged with the dimen tag and represent a name value pair. 
    • Dimension resources are defined in XML under the /res/values project directory.
    • Exa. Types of measurement…
    • Exa. How to write a dimension resources in .xml
    • Exa. How to access in .java file
  • Working with Simple drawable resources
    • You can specify simple colored rectangles by using the drawable resource type, which can then be applied to other screen elements
    • Drawable resources are defined in XML under the /res/values project directory.
    • Paintable drawable resources use the drawable tag and represent a name-value pair.
    • Exa. How to write a simple drawable resources in .xml
    • Exa. How to access in .java file
  • Working with image resources
    • Applications often include visual elements such as icons and graphics.
    • Android supports several image formats such as..

    • Simply drag the image asset into /res/drawable directory.
    • These image formats are all well supported by popular graphics editors such as Adobe Photoshop, GIMP, and Microsoft Paint.
    • The Nine-Patch Stretchable Graphics can be created from PNG files using the draw9patch tool included with the Android SDK under the /tools directory.
  • Working with Animation resources
    • Android supports frame-by-frame animation and tween animation. 
      • Frame-by-frame animation involves the display of a sequence of images in rapid succession.
      • Tweened animation involves applying standard graphical transformations such as rotations and fades upon a single image.
    • How to define frame-by-frame resources?
    • Exa.
      • Save each frame graphic as an individual drawable resource. Exa. step01.jpg,step02.jpg…
      • Define the animation set resource in an XML file within /res/drawable/ resource directory.
      • Load, start, and stop the animation programs.

Thanks a lot for query or your valuable suggestions related to the topic.

Previous Post Next Post

Contact Form