6

I'd like to develop a live wallpaper. After some research, I concluded that there were two options to create one :

I've never developed Live Wallpaper. Which solution is the easiest and fastest?

afuzzyllama
  • 6,538
  • 5
  • 47
  • 64
Trox
  • 349
  • 1
  • 5
  • 15

3 Answers3

4

You can handle the drawing directly, as in the Cube example in the SDK. Or you can use OpenGl ES, e.g. via AndEngine, LibGDX, GLWallpaperService, or RenderScript. More work, but better performance.

If your wallpaper is fairly simple, I would suggest doing the drawing yourself. That is what most people do. If you need "physics" (e.g. a particle system), look at AndEngine or LibGDX. If you need 3D, look at GLWallpaperService. In addition to the Cube example, you might want to look at the Android system source code to see how the stock wallpapers (Grass, Galaxy, etc.) use RenderScript. This link may get you there, but things keep moving: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.1.1_r1/com/android/wallpaper/ (then scroll down to the wallpapers)

Good luck. George.

George Freeman
  • 2,260
  • 1
  • 15
  • 22
2

I suggest Rajawali: https://github.com/MasDennis/Rajawali A 3D engine for Android based on OpenGL ES 2.0

Sarpe
  • 5,747
  • 2
  • 28
  • 26
0

It sure is easier to develop with a game engine. Unity engine is pretty good for that, with its visual editor, good asset import pipeline a tons of stuff on Asset Store that would help to boost your development. There are other game engines tyou could use for live wallpapers, but it'd be a much more tedious task.

The negative side of using Unity is that ti might be somewhat heavy - it's expected to have an minimal APK of around 9 MB in size This doesn't really matters if you have a resource-heavy live wallpaper, though.

I've recently released uLiveWallpaper - a Unity asset that makes it possible to create live wallpapers for Android using Unity 5. It is well-tested and reliable, creates projects for Android Studio, complete with placeholder code to get you started.

Unity is probably not the best option if you want to make something really simple, but definitely the best option if you aim for high visual quality.

Check out uLiveWallpaper forum thread here: http://forum.unity3d.com/threads/ulivewallpaper-develop-android-live-wallpapers-with-unity-5.375255/

Or just search up for "uLiveWallpaper".

ZimM
  • 91
  • 1
  • 5
  • I'm using Unity 5 to develop a live wallpaper for android and it consumes 120MB of RAM in a Samsung Galaxy S5 phone. The scene is very simple for test purposes but is not possible that uses 120 MB for a simple scene. If you know a way to reduce this memory cost I will go through your plugin. – ariel Feb 02 '16 at 00:10
  • @ariel It is impossible to give any advice because I have no idea what scene do you have. 120MB doesn't sounds right. My demo live wallpaper only consumes 40MB of RAM. How are you measuring the RAM consumption? – ZimM Feb 02 '16 at 07:59
  • It's strange, when I dump the memory after a GC in eclipse I see that my live wallpaper consumes 15MB and the heap is 30MB, but, when I see statistics under phone developer options or under the application manager I see first that the ram used is 120MB and one day later is 90MB...do you have any idea? Because it's bad to the eyes of the final user...the battery consumption doesn't change too much... – ariel Feb 04 '16 at 22:22
  • @ariel No idea. It's impossible to say anything without more data. It could be because of anything: Android version, Unity version, build settings etc. – ZimM Feb 05 '16 at 02:46
  • Ok, I buyed your professional plugin version and it works fine, except that I modify the code to work with Unity 5.3, you must update the plugin. I will contact you in the forum to see this problem, maybe we can find a solution. Thanks! – ariel Feb 06 '16 at 16:27
  • @ariel Um, have you posted the problem in the forum? I've tested the current version with Unity 5.3 and found no issues. – ZimM Feb 06 '16 at 20:26