原文:http://www.androiddevblog.net/android/creating-android-live-wallpaper
动态壁纸主要使用以下两个类:
WallpaperService and WallpaperService.Engine
WallpaperService比普通的Service多了一个onCreateEngine()方法,声明如下:
abstract WallpaperService.Engine onCreateEngine(),返回WallpaperService.Engine对象。
编写动态壁纸步聚如下:
1AndroidManifest.xml
2,编写WallpaperService的子类,重载onCreateEngine方法,让此方法返回一个我们自己的 WallpaperService.Engine的实现类。
未完。
动态壁纸主要使用以下两个类:
WallpaperService and WallpaperService.Engine
WallpaperService比普通的Service多了一个onCreateEngine()方法,声明如下:
abstract WallpaperService.Engine onCreateEngine(),返回WallpaperService.Engine对象。
编写动态壁纸步聚如下:
1AndroidManifest.xml
<application android:label="@string/app_name" android:icon="@drawable/icon">
<service android:label="@string/wallpaper_pattern" android:permission="android.permission.BIND_WALLPAPER" android:name="com.varma.samples.patternwallpaper.PatternWallpaper">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper" android:resource="@xml/patternwallpaper" />
</service>
<activity android:label="@string/wallpaper_settings" android:name="com.varma.samples.patternwallpaper.PatternWallpaperSettings" android:exported="true"/>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-feature android:name="android.software.live_wallpaper" />
2,编写WallpaperService的子类,重载onCreateEngine方法,让此方法返回一个我们自己的 WallpaperService.Engine的实现类。
未完。