简体   繁体   English

我应该在哪里初始化Android动态壁纸的资源

[英]Where should I initialize resources for an Android Live Wallpaper

I am developing a live wallpaper for Android. 我正在为Android开发一个动态壁纸。 The wallpaper allocates some resources such as background bitmaps, sprites, textures, etc. 壁纸分配一些资源,如背景位图,精灵,纹理等。

The question is: where should I allocate and initialize all of the resources? 问题是:我应该在哪里分配和初始化所有资源? Should I allocate them in WallpaperService.Engine inherited object's constructor or onCreate(SurfaceHolder surfaceHolder) method? 我应该在WallpaperService.Engine继承对象的构造函数或onCreate(SurfaceHolder surfaceHolder)方法中分配它们吗?

Short Answer is yes SurfaceHolder or WallpaperService . 简答言SurfaceHolderWallpaperService since explaining the whole method procedure is pretty huge. 因为解释整个方法程序是非常巨大的。

Am gonna hook you up by some nice tutorials, just follow them http://www.rajeeshcv.com/post/details/36/create-a-live-aquarium-wallpaper-in-android 我会通过一些很好的教程来帮助你,只需按照它们http://www.rajeeshcv.com/post/details/36/create-a-live-aquarium-wallpaper-in-android

Another one http://learnandroideasily.blogspot.ae/2013/07/android-livewallpaer-tutorial.html 另一个http://learnandroideasily.blogspot.ae/2013/07/android-livewallpaer-tutorial.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM