Android 动态壁纸指南
说到制作Android动态壁纸,到底需要什么东西呢?到目前为止,我可以要点为WallpaperService.Engine、SurfaceView、Android.manifest 和xml/string.xml 中的一些主要更改,除了这个png drawble(我认为如果我使用paint,这可能是可选的)。
我还需要什么来开发完全不同的逻辑才能使动画发生?总是用数学计算吗?我非常热衷于制作不同类型的动态壁纸。但我认为我没有走在正确的轨道上。
请建议我找到正确的方向,总结我所需要的一切,以便我可以制作任何类型的动态壁纸。
有人可以总结一下动态壁纸需要什么吗?
提前致谢。
When it comes to making Android live wallpaper, what are the things that are exactly needed. So far I could gist as WallpaperService.Engine, SurfaceView, some major changes in Android.manifest and xml/string.xml apart from this one png drawble (i think this may be optional if i use paint).
And what else do I need to develop whole different logic for the animation to happen? is it with mathematical calculations always? I am very keen about making different kind of live wallpaper. but i am not in the right track i think.
Please suggest me some way out to right direction summarizing me what all i need so that i can make any kind of live wallpaper.
Can somebody please summarize what all is needed for live wall paper.
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您好,如果您有图像路径,您可以使用此代码。
................................................. 如果你有图像 URI,然后使用它
............如果有任何问题请告诉我。
Hi you can use this code if You have Image path.
................................................. if you have image URI then use this
.............. Let me know if there is any issue .
是的,您需要对 Android 中的动态壁纸使用与“普通”动画不同的方法。标准方法是制作一个绘制到画布上的自重新调度可运行程序。
回答您的一个具体问题:不,您不需要将自己限制在数学计算上;如果您选择,您可以使用位图/精灵,但您需要自己为它们设置动画。
最好的起点是 SDK 中的资源:
http://developer.android.com/resources/articles/live-wallpapers.html
http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html
Yes, you need to use a different approach for live wallpaper than "normal" animation in Android. The standard approach is to make a self-rescheduling runnable that draws to canvas.
In answer to one of your specific questions: no, you do not need to limit yourself to mathematical calculations; you can use bitmaps/sprites if you choose, but you will need to animate them yourself.
Your best place to start is the resources in the SDK:
http://developer.android.com/resources/articles/live-wallpapers.html
http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html