Getting the icon for your Android live wallpaper to be displayed in the live wallpaper list

Getting the icon for your Android live wallpaper to be displayed in the live wallpaper list is a relatively simple affair. You need to do 2 things, the first is edit your Android manifest and next you need to associate the live wallpaper xml asset reference document to the manifest xml. this is how it works

1. the android manifest xml

manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ayobinitie.bizarremachine_i"
android:versionCode="3"
android:versionName="1.21" >

uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />

uses-feature
android:name="android.software.live_wallpaper"
android:required="true" />


application
android:allowBackup="true"
android:icon="@drawable/iconthumb"
android:label="@string/app_name" >
service
android:name=".MyWallpaper"
android:enabled="true"
android:icon="@drawable/iconthumb"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER" >
intent-filter>
action android:name="android.service.wallpaper.WallpaperService" />
/intent-filter>

meta-data
android:name="@string/wallpaperpackage"
android:resource="@xml/wallpaper" />
/service>
/application>
/manifest>


2. the wallpaper.xml - this is in res/xml

xml version="1.0" encoding="utf-8"?>
wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="@drawable/wallpapericon"
android:description="@string/wallpaperdescription"/>



N.B: I had a recent problem where inspite of all my efforts I could neither get the icon or the descriptions to show. All I did was delete the wallpaper.xml, rewrite it and all was perfect. I think that in someway Eclipse and the ADT did not register the wallpaper.xml correctly. Forcing it to redo this by deleting and rewriting the wallpaper.xml fixed it.

0 comments:

My Instagram