Android: Live Wallpapers




Thursday, 18 February 2010
What are live wallpapers?

                     “Richer, animated, interactive backgrounds”
                     Provides another means for the user to interact with
                      your app on their desktop
                     Similar to regular Android service, so the application
                      becomes the desktop!




Thursday, 18 February 2010
What do I need?

                     Android SDK > 2.1
                     Eclipse
                     ADT for Eclipse




Thursday, 18 February 2010
Android API Levels




                   http://developer.android.com/guide/appendix/
                    api-levels.html



Thursday, 18 February 2010
Setting up the Android manifest

                     Service permission of
                      android.permission.BIND_WALLPAPER
                     API Level 7 for > 2.1
                      <uses-sdk android:minSdkVersion="7" />

                     Use feature tag
                      <uses-feature
                      android:name="android.software.live_wallpaper" />




Thursday, 18 February 2010
Example Android manifest




Thursday, 18 February 2010
Wallpaper Service

                     Abstract class, implement and override
                      onCreateEngine()
                     http://developer.android.com/reference/android/
                      service/wallpaper/WallpaperService.html




Thursday, 18 February 2010
Life Cycle

                   onCreate()
                   onDestroy()
                   onVisibility()
                   onOffsetsChanged()
                   onSurface...() created, changed, destroyed
                   onTouchEvent()




Thursday, 18 February 2010
Gotchas

                     Battery life!
                     CPU even 1ghz is not infinite
                     onVisibility(), when the wallpaper becomes invisible
                      shut everything down

                     Multi touch?




Thursday, 18 February 2010
Other options

                     Widgets
                     Apps




Thursday, 18 February 2010
Demo




Thursday, 18 February 2010

Android Live Wallpapers

  • 1.
  • 2.
    What are livewallpapers?  “Richer, animated, interactive backgrounds”  Provides another means for the user to interact with your app on their desktop  Similar to regular Android service, so the application becomes the desktop! Thursday, 18 February 2010
  • 3.
    What do Ineed?  Android SDK > 2.1  Eclipse  ADT for Eclipse Thursday, 18 February 2010
  • 4.
    Android API Levels  http://developer.android.com/guide/appendix/ api-levels.html Thursday, 18 February 2010
  • 5.
    Setting up theAndroid manifest  Service permission of android.permission.BIND_WALLPAPER  API Level 7 for > 2.1 <uses-sdk android:minSdkVersion="7" />  Use feature tag <uses-feature android:name="android.software.live_wallpaper" /> Thursday, 18 February 2010
  • 6.
  • 7.
    Wallpaper Service  Abstract class, implement and override onCreateEngine()  http://developer.android.com/reference/android/ service/wallpaper/WallpaperService.html Thursday, 18 February 2010
  • 8.
    Life Cycle  onCreate()  onDestroy()  onVisibility()  onOffsetsChanged()  onSurface...() created, changed, destroyed  onTouchEvent() Thursday, 18 February 2010
  • 9.
    Gotchas  Battery life!  CPU even 1ghz is not infinite  onVisibility(), when the wallpaper becomes invisible shut everything down  Multi touch? Thursday, 18 February 2010
  • 10.
    Other options  Widgets  Apps Thursday, 18 February 2010
  • 11.