Hello everyone, I'm wondering how we go about making an icon for our live wallpaper on the home screen? I'm finding that after the user install my wallpaper there's a lot of them who just forget that they even installed it on there. Seems to happen more often than not on the larger wall papers. anybody got any idea?
Check out this tutorial http://www.livewallpapercreator.com/community/index.php?threads/add-an-icon-to-the-app-drawer.206/
yep I checked that one out already, doesn't that one only the settings menu? it doesn't go to the live wallpaper itself where they can actually see it and set it i think.
You can create an activity for your wallpaper and add the below code to a button.This will bring up the preview screen directly Note this only applies to API level 16 or greater Code (text): public void onClick(View view) { Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER); intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(this, MyWallpaperService.class)); startActivity(intent); } For lower versions, you can use the following code. This will bring up the live wallpaper chooser Code (text): public void onClick(View v) { Intent intent = new Intent(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER); startActivity(intent); }
Thanks james for your help, but how would one add that to the manifest and code itself? I'm still pretty new to android development so, not sure where to go from there.
You can add the second activity code mentioned below in your manifest file insdie the application tag Code (text): <application android:label="@string/application_name" android:icon="@drawable/icon"> <service android:label="@string/service_name" android:name="com.james.backgrounddemo.SBLiveWallpaper" android:permission="android.permission.BIND_WALLPAPER"> <intent-filter> <action android:name="android.service.wallpaper.WallpaperService" /> </intent-filter> <meta-data android:name="android.service.wallpaper" android:resource="@xml/lwp_resource" /> </service> <activity android:label="Settings" android:name="com.james.backgrounddemo.LiveWallpaperSettings" android:theme="@android:style/Theme.WallpaperSettings" android:exported="true"> </activity> <activity android:name="com.james.backgrounddemo.MainActivity" android:label="Main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> Just replace the package name and MainActivity class name with your activity in the android:name section. As for the activity you would have to design it and place a buuton inside it. You would have to check some android tutorials to do that. Below is a link to a list of Android tutorials on youtube: https://www.youtube.com/playlist?list=PLB03EA9545DD188C3