How to Create a Live Wallpaper

Asked

Viewed 485 times

-1

I would like to know in which area of the application (Androidmanifest.xml, etc.) I need to indicate that my application is able to provide wallpapers to the area of Live Wallpapers.

1 answer

2


Your question is wide, but Live Wallpaper is a service, so you’ll have to declare this service on your Androidmanifest.xml, remembering that this service requires permission android.permission.BIND_WALLPAPER and must be registered via Intent-filter for the action android.service.wallpaper.WallpaperService.

Here is the example provided by the site Vogella;

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="de.vogella.android.wallpaper"
    android:versionCode="1"
    android:versionName="1.0" >

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <service
            android:name="MyWallpaperService"
            android:enabled="true"
            android:label="Wallpaper Example "
            android:permission="android.permission.BIND_WALLPAPER" >
            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" >
                </action>
            </intent-filter>

            <meta-data
                android:name="android.service.wallpaper"
                android:resource="@xml/mywallpaper" >
            </meta-data>
        </service>

        <activity
            android:name=".MyPreferencesActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Light.WallpaperSettings" >
        </activity>
        <activity
            android:name=".SetWallpaperActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Light.WallpaperSettings" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <uses-sdk android:minSdkVersion="10" />

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

</manifest> 

On this same site you can find all the information you need to create a Live Wallpaper but requires a basic knowledge of English.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.