SlideShare uma empresa Scribd logo
1 de 24
Android
mobilių programėlių kūrimo įvadas
Drawable Resources
A drawable resource is a general concept for a graphic that can be drawn to the screen and
which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with
attributes such as android:drawable and android:icon.

Bitmap File - A bitmap graphic file (.png, .jpg, or .gif).   State List - An XML file that references different
Creates a BitmapDrawable.                                    bitmap graphics for different states (for example, to
                                                             use a different image when a button is pressed).
Nine-Patch File - A PNG file with stretchable regions to     Creates a StateListDrawable.
allow image resizing based on content (.9.png).
Creates a NinePatchDrawable.                                 Shape Drawable - An XML file that defines a
                                                             geometric shape, including colors and gradients.
Animation Resource - An animation defined in XML             Creates a ShapeDrawable.
that modifies properties of the target object, such as
background color or alpha value, over a set amount of        Transition Drawable - An XML file that defines a
time.                                                        drawable that can cross-fade between two drawable
                                                             resources. Creates a TransitionDrawable.
Bitmap
         A bitmap image. Android supports bitmap files in a three
         formats:
         - .png (preferred)
         - .jpg (acceptable)
         - .gif (discouraged).

         Note: Bitmap files may be automatically optimized with
         lossless image compression by the aapt tool during the build
         process. For example, a true-color PNG that does not require
         more than 256 colors may be converted to an 8-bit PNG with
         a color palette.
XML Bitmap
             An XML bitmap is a resource defined in XML
             that points to a bitmap file. The effect is an
             alias for a raw bitmap file. The XML can
             specify additional properties for the bitmap
             such as dithering and tiling.

             Note: You can use a <bitmap> element as a
             child of an <item> element. For example,
             when creating a state list or layer list, you can
             exclude the android:drawable attribute from an
             <item> element and nest a <bitmap> inside it
             that defines the drawable item.
Nine-Patch File
                  A NinePatchDrawable graphic is a stretchable
                  bitmap image, which Android will automatically
                  resize to accommodate the contents of the
                  View in which you have placed it as the
                  background. An example use of a NinePatch
                  is the backgrounds used by standard Android
                  buttons — buttons must stretch to
                  accommodate strings of various lengths. A
                  NinePatch drawable is a standard PNG image
                  that includes an extra 1-pixel-wide border. It
                  must be saved with the extension .9.png, and
                  saved into the res/drawable/ directory of your
                  project.
XML Nine-Patch
                 An XML Nine-Patch is a resource defined in
                 XML that points to a Nine-Patch file. The XML
                 can specify dithering for the image.
Layer List
             A LayerDrawable is a drawable object that
             manages an array of other drawables. Each
             drawable in the list is drawn in the order of the
             list—the last drawable in the list is drawn on
             top.

             Each drawable is represented by an <item>
             element inside a single <layer-list> element.
State List
             A StateListDrawable is a drawable object
             defined in XML that uses a several different
             images to represent the same graphic,
             depending on the state of the object. For
             example, a Button widget can exist in one of
             several different states (pressed, focused, or
             niether) and, using a state list drawable, you
             can provide a different background image for
             each state.
State List
             Note: Remember that Android applies the first
             item in the state list that matches the current
             state of the object. So, if the first item in the
             list contains none of the state attributes
             above, then it is applied every time, which is
             why your default value should always be last
             (as demonstrated in the following example).
Transition Drawable
                      A TransitionDrawable is a drawable object that
                      can cross-fade between the two drawable
                      resources.

                      Each drawable is represented by an <item>
                      element inside a single <transition> element.
                      No more than two items are supported. To
                      transition forward, call startTransition(). To
                      transition backward, call reverseTransition().
Clip Drawable
                A drawable defined in XML that clips another
                drawable based on this Drawable's current
                level. You can control how much the child
                drawable gets clipped in width and height
                based on the level, as well as a gravity to
                control where it is placed in its overall
                container. Most often used to implement
                things like progress bars.
Shape Drawable
This is a generic shape defined in XML.
Common use - a Drawable with a color gradient for buttons, backgrounds, etc.
Shape Drawable
Support Library
The support library for v4 provides access to several classes introduced with Android 3.0 and
beyond, plus some updated version of existing classes, and even some APIs that currently don't
exist in the Android platform. Some of the most useful and notable classes that have
counterparts in the v4 support library are:

- Fragment
- FragmentManager
- FragmentTransaction
- ListFragment
- DialogFragment
- LoaderManager
- Loader
- AsyncTaskLoader
- CursorLoader
Fragments
Fragments
            To manage your fragments and
            loaders, you must use the
            methods
            FragmentActivity.getSupportFrag
            mentManager() and
            FragmentActivity.getSupportLoad
            erManager() (instead of the
            getFragmentManager() and
            getLoaderManager() methods).
Fragments
            Implementation of PagerAdapter that uses a
            Fragment to manage each page. This class
            also handles saving and restoring of
            fragment's state.

            This version of the pager is more useful when
            there are a large number of pages, working
            more like a list view. When pages are not
            visible to the user, their entire fragment may
            be destroyed, only keeping the saved state of
            that fragment. This allows the pager to hold
            on to much less memory associated with each
            visited page as compared to
            FragmentPagerAdapter at the cost of
            potentially more overhead when switching
            between pages.
Fragments
Adapters
Adapters are used to provide the data to the ListView
object. The adapter also defines how each row is the
ListView is displayed.

The adapter is assigned to the ListView via the
setAdapter method on the ListView object.

An adapter extend the BaseAdapter class. Android
provides some standard adapters; the most important
are ArrayAdapter and CursorAdapter.

ArrayAdapter can handle data based on Arrays or
java.util.List.

SimpleCursorAdapter can handle database related
data. This description focuses on the non database
case.
Adapters
Async Task
RecognitionListener
                      Used for receiving notifications
                      from the SpeechRecognizer when
                      the recognition related events
                      occur. All the callbacks are
                      executed on the Application main
                      thread.
RecognitionListener
Q&A
v.valkaitis@appcamp.lt

Mais conteúdo relacionado

Mais procurados

Mapreduce advanced
Mapreduce advancedMapreduce advanced
Mapreduce advancedChirag Ahuja
 
Hive and HiveQL - Module6
Hive and HiveQL - Module6Hive and HiveQL - Module6
Hive and HiveQL - Module6Rohit Agrawal
 
Scalable Data Analysis in R Webinar Presentation
Scalable Data Analysis in R Webinar PresentationScalable Data Analysis in R Webinar Presentation
Scalable Data Analysis in R Webinar PresentationRevolution Analytics
 
Hive Demo Paper at VLDB 2009
Hive Demo Paper at VLDB 2009Hive Demo Paper at VLDB 2009
Hive Demo Paper at VLDB 2009Namit Jain
 

Mais procurados (8)

NoSQL - Leo's notes
NoSQL - Leo's notesNoSQL - Leo's notes
NoSQL - Leo's notes
 
Unit 5-lecture4
Unit 5-lecture4Unit 5-lecture4
Unit 5-lecture4
 
Mapreduce advanced
Mapreduce advancedMapreduce advanced
Mapreduce advanced
 
Hive and HiveQL - Module6
Hive and HiveQL - Module6Hive and HiveQL - Module6
Hive and HiveQL - Module6
 
Hadoop map reduce concepts
Hadoop map reduce conceptsHadoop map reduce concepts
Hadoop map reduce concepts
 
Chap14 ado.net
Chap14 ado.netChap14 ado.net
Chap14 ado.net
 
Scalable Data Analysis in R Webinar Presentation
Scalable Data Analysis in R Webinar PresentationScalable Data Analysis in R Webinar Presentation
Scalable Data Analysis in R Webinar Presentation
 
Hive Demo Paper at VLDB 2009
Hive Demo Paper at VLDB 2009Hive Demo Paper at VLDB 2009
Hive Demo Paper at VLDB 2009
 

Semelhante a "Android" mobilių programėlių kūrimo įvadas #4

Introductontoxaml
IntroductontoxamlIntroductontoxaml
Introductontoxamlsunhope777
 
Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Barry DeCicco
 
ATG Framework,Formhandlers,Pricing
ATG Framework,Formhandlers,PricingATG Framework,Formhandlers,Pricing
ATG Framework,Formhandlers,Pricingpraveen chinnam
 
Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkitnikhilyagnic
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Android Resources.docx
Android Resources.docxAndroid Resources.docx
Android Resources.docxKNANTHINIMCA
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1shiv_nj
 
1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf
1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf
1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdfanonaeon
 
Xamarin Workshop Noob to Master - Week 3
Xamarin Workshop Noob to Master - Week 3Xamarin Workshop Noob to Master - Week 3
Xamarin Workshop Noob to Master - Week 3Charlin Agramonte
 
Wpf-Xaml And Layout Basics
Wpf-Xaml And Layout BasicsWpf-Xaml And Layout Basics
Wpf-Xaml And Layout BasicsRobin Aggarwal
 
Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10Dr. Ramkumar Lakshminarayanan
 
03 android application structure
03 android application structure03 android application structure
03 android application structureSokngim Sa
 

Semelhante a "Android" mobilių programėlių kūrimo įvadas #4 (20)

Introductontoxaml
IntroductontoxamlIntroductontoxaml
Introductontoxaml
 
Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06
 
ATG Framework,Formhandlers,Pricing
ATG Framework,Formhandlers,PricingATG Framework,Formhandlers,Pricing
ATG Framework,Formhandlers,Pricing
 
Unit 3
Unit 3Unit 3
Unit 3
 
Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkit
 
CS267_Graph_Lab
CS267_Graph_LabCS267_Graph_Lab
CS267_Graph_Lab
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Android Resources.docx
Android Resources.docxAndroid Resources.docx
Android Resources.docx
 
XAML and WPF - Dinko Jakovljević
XAML and WPF - Dinko JakovljevićXAML and WPF - Dinko Jakovljević
XAML and WPF - Dinko Jakovljević
 
R-Shiny Cheat sheet
R-Shiny Cheat sheetR-Shiny Cheat sheet
R-Shiny Cheat sheet
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1
 
1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf
1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf
1.static int HORIZONTAL_WRAP2. Container view controllers are most.pdf
 
Hello Android
Hello AndroidHello Android
Hello Android
 
Xamarin Workshop Noob to Master - Week 3
Xamarin Workshop Noob to Master - Week 3Xamarin Workshop Noob to Master - Week 3
Xamarin Workshop Noob to Master - Week 3
 
List Views
List ViewsList Views
List Views
 
Wpf-Xaml And Layout Basics
Wpf-Xaml And Layout BasicsWpf-Xaml And Layout Basics
Wpf-Xaml And Layout Basics
 
Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10
 
Windows phone and azure
Windows phone and azureWindows phone and azure
Windows phone and azure
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
03 android application structure
03 android application structure03 android application structure
03 android application structure
 

Último

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 

Último (20)

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 

"Android" mobilių programėlių kūrimo įvadas #4

  • 2. Drawable Resources A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon. Bitmap File - A bitmap graphic file (.png, .jpg, or .gif). State List - An XML file that references different Creates a BitmapDrawable. bitmap graphics for different states (for example, to use a different image when a button is pressed). Nine-Patch File - A PNG file with stretchable regions to Creates a StateListDrawable. allow image resizing based on content (.9.png). Creates a NinePatchDrawable. Shape Drawable - An XML file that defines a geometric shape, including colors and gradients. Animation Resource - An animation defined in XML Creates a ShapeDrawable. that modifies properties of the target object, such as background color or alpha value, over a set amount of Transition Drawable - An XML file that defines a time. drawable that can cross-fade between two drawable resources. Creates a TransitionDrawable.
  • 3. Bitmap A bitmap image. Android supports bitmap files in a three formats: - .png (preferred) - .jpg (acceptable) - .gif (discouraged). Note: Bitmap files may be automatically optimized with lossless image compression by the aapt tool during the build process. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit PNG with a color palette.
  • 4. XML Bitmap An XML bitmap is a resource defined in XML that points to a bitmap file. The effect is an alias for a raw bitmap file. The XML can specify additional properties for the bitmap such as dithering and tiling. Note: You can use a <bitmap> element as a child of an <item> element. For example, when creating a state list or layer list, you can exclude the android:drawable attribute from an <item> element and nest a <bitmap> inside it that defines the drawable item.
  • 5. Nine-Patch File A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background. An example use of a NinePatch is the backgrounds used by standard Android buttons — buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG image that includes an extra 1-pixel-wide border. It must be saved with the extension .9.png, and saved into the res/drawable/ directory of your project.
  • 6. XML Nine-Patch An XML Nine-Patch is a resource defined in XML that points to a Nine-Patch file. The XML can specify dithering for the image.
  • 7. Layer List A LayerDrawable is a drawable object that manages an array of other drawables. Each drawable in the list is drawn in the order of the list—the last drawable in the list is drawn on top. Each drawable is represented by an <item> element inside a single <layer-list> element.
  • 8. State List A StateListDrawable is a drawable object defined in XML that uses a several different images to represent the same graphic, depending on the state of the object. For example, a Button widget can exist in one of several different states (pressed, focused, or niether) and, using a state list drawable, you can provide a different background image for each state.
  • 9. State List Note: Remember that Android applies the first item in the state list that matches the current state of the object. So, if the first item in the list contains none of the state attributes above, then it is applied every time, which is why your default value should always be last (as demonstrated in the following example).
  • 10. Transition Drawable A TransitionDrawable is a drawable object that can cross-fade between the two drawable resources. Each drawable is represented by an <item> element inside a single <transition> element. No more than two items are supported. To transition forward, call startTransition(). To transition backward, call reverseTransition().
  • 11. Clip Drawable A drawable defined in XML that clips another drawable based on this Drawable's current level. You can control how much the child drawable gets clipped in width and height based on the level, as well as a gravity to control where it is placed in its overall container. Most often used to implement things like progress bars.
  • 12. Shape Drawable This is a generic shape defined in XML. Common use - a Drawable with a color gradient for buttons, backgrounds, etc.
  • 14. Support Library The support library for v4 provides access to several classes introduced with Android 3.0 and beyond, plus some updated version of existing classes, and even some APIs that currently don't exist in the Android platform. Some of the most useful and notable classes that have counterparts in the v4 support library are: - Fragment - FragmentManager - FragmentTransaction - ListFragment - DialogFragment - LoaderManager - Loader - AsyncTaskLoader - CursorLoader
  • 16. Fragments To manage your fragments and loaders, you must use the methods FragmentActivity.getSupportFrag mentManager() and FragmentActivity.getSupportLoad erManager() (instead of the getFragmentManager() and getLoaderManager() methods).
  • 17. Fragments Implementation of PagerAdapter that uses a Fragment to manage each page. This class also handles saving and restoring of fragment's state. This version of the pager is more useful when there are a large number of pages, working more like a list view. When pages are not visible to the user, their entire fragment may be destroyed, only keeping the saved state of that fragment. This allows the pager to hold on to much less memory associated with each visited page as compared to FragmentPagerAdapter at the cost of potentially more overhead when switching between pages.
  • 19. Adapters Adapters are used to provide the data to the ListView object. The adapter also defines how each row is the ListView is displayed. The adapter is assigned to the ListView via the setAdapter method on the ListView object. An adapter extend the BaseAdapter class. Android provides some standard adapters; the most important are ArrayAdapter and CursorAdapter. ArrayAdapter can handle data based on Arrays or java.util.List. SimpleCursorAdapter can handle database related data. This description focuses on the non database case.
  • 22. RecognitionListener Used for receiving notifications from the SpeechRecognizer when the recognition related events occur. All the callbacks are executed on the Application main thread.