Android Support Package




             +Handaru Sakti
“There are three things to remember about being
a starship captain: keep your shirt tucked in, go
down with the ship... and never abandon a
member of your crew.”
      Captain Kathryn Janeway, Star Trek: Voyager


“No man left behind.”
                                 U.S. Navy SEALs
Our Desserts:




Data collected during a 14-day period ending on September 4, 2012,
          http://developer.android.com/about/dashboards/index.html
●   Damn...new APIs comes with new cool
    features
●   How to bring them to previous Android APIs?
●   Android Support Package offers backward
    compatibility
Some Famous Features
●   Fragment
●   Viewpager
●   NotificationCompat
●   ShareCompat
●   NavUtils and TaskStackBuilder
●   Loader
●   ServiceCompat
●   LocalBroadcastManager
●   Sadly...The ActionBar is not supported
Fragment

A modular section of an activity, which has its
own lifecycle, receives its own input events,
and which you can add or remove while the
activity is running (sort of like a "sub activity"
that you can reuse in different activities).
Viewpager
Layout manager that allows the user to flip left
and right through pages of data
NotificationCompat

Large-format notifications that:
   –   include a lot of text.
   –   large image attachment.
   –   a list of (up to 5) strings.
   –   can apply a rich notification style.
ShareCompat

For sharing data between activities.
ShareCompat provides functionality to extend
the
ACTION_SEND/ACTION_SEND_MULTIPLE
protocol and support retrieving more info
about the activity that invoked a social sharing
action
NavUtils and TaskStackBuilder
To provide support for implementing the
Android Design guidelines for navigation.
These additions include a way to implement
the action bar's Up button across versions.
Loader
●   Introduced in Android 3.0, loader makes it easy to
    asynchronously load data in an activity or fragment.
●   Loader has these characteristics:
        –   They are available to every Activity and Fragment.
        –   They provide asynchronous loading of data.
        –   They monitor the source of their data and deliver
             new results when the content changes.
        –   They automatically reconnect to the last loader's
             cursor when being recreated after a
             configuration change. Thus, they don't need to
             re-query their data.
ServiceCompat

For accessing features in Service introduced
after API level 4 in a backwards compatible
fashion
LocalBroadcastManager

To allow applications to easily register for and
receive intents within a single application
without broadcasting them globally.
3 ASP

●   v-4
          –   <uses-sdk android:minSdkVersion="ASP"
               android:targetSdkVersion="latest API" />
          –   Sorry to Cupcake, you are a man left behind
●   v-13
●   v-7 (Special -> GridLayout)
Revision

●   Until now, 10th revision
●   More details:
    http://developer.android.com/tools/extras/supp
    ort-library.html
Implementation

●   Download via Android SDK Manager
    (<sdk>/extras/android/compatibility/)
●   Add to Build Path or bring to libs directory
    below root directory
●   Import your class
Matur Suwun, Derek!
GDG Surabaya DevFest 2012

Android Support Package

  • 1.
  • 2.
    “There are threethings to remember about being a starship captain: keep your shirt tucked in, go down with the ship... and never abandon a member of your crew.” Captain Kathryn Janeway, Star Trek: Voyager “No man left behind.” U.S. Navy SEALs
  • 3.
    Our Desserts: Data collectedduring a 14-day period ending on September 4, 2012, http://developer.android.com/about/dashboards/index.html
  • 4.
    Damn...new APIs comes with new cool features ● How to bring them to previous Android APIs? ● Android Support Package offers backward compatibility
  • 5.
    Some Famous Features ● Fragment ● Viewpager ● NotificationCompat ● ShareCompat ● NavUtils and TaskStackBuilder ● Loader ● ServiceCompat ● LocalBroadcastManager ● Sadly...The ActionBar is not supported
  • 6.
    Fragment A modular sectionof an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a "sub activity" that you can reuse in different activities).
  • 8.
    Viewpager Layout manager thatallows the user to flip left and right through pages of data
  • 9.
    NotificationCompat Large-format notifications that: – include a lot of text. – large image attachment. – a list of (up to 5) strings. – can apply a rich notification style.
  • 11.
    ShareCompat For sharing databetween activities. ShareCompat provides functionality to extend the ACTION_SEND/ACTION_SEND_MULTIPLE protocol and support retrieving more info about the activity that invoked a social sharing action
  • 13.
    NavUtils and TaskStackBuilder Toprovide support for implementing the Android Design guidelines for navigation. These additions include a way to implement the action bar's Up button across versions.
  • 15.
    Loader ● Introduced in Android 3.0, loader makes it easy to asynchronously load data in an activity or fragment. ● Loader has these characteristics: – They are available to every Activity and Fragment. – They provide asynchronous loading of data. – They monitor the source of their data and deliver new results when the content changes. – They automatically reconnect to the last loader's cursor when being recreated after a configuration change. Thus, they don't need to re-query their data.
  • 16.
    ServiceCompat For accessing featuresin Service introduced after API level 4 in a backwards compatible fashion
  • 17.
    LocalBroadcastManager To allow applicationsto easily register for and receive intents within a single application without broadcasting them globally.
  • 18.
    3 ASP ● v-4 – <uses-sdk android:minSdkVersion="ASP" android:targetSdkVersion="latest API" /> – Sorry to Cupcake, you are a man left behind ● v-13 ● v-7 (Special -> GridLayout)
  • 19.
    Revision ● Until now, 10th revision ● More details: http://developer.android.com/tools/extras/supp ort-library.html
  • 20.
    Implementation ● Download via Android SDK Manager (<sdk>/extras/android/compatibility/) ● Add to Build Path or bring to libs directory below root directory ● Import your class
  • 21.
    Matur Suwun, Derek! GDGSurabaya DevFest 2012