Android的动态壁纸 - OpenGL的VS帆布 [英] Android Live Wallpapers -- OpenGL vs Canvas

查看:129
本文介绍了Android的动态壁纸 - OpenGL的VS帆布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个相当福利局Android开发者,我想我是一个活的壁纸第一批项目之一,不过,我对冲突我是否应该把重点放在画布或OpenGL吧。作为新来这个,我知道我应该掌握的画布首先,因为它更容易使用,但我preFER从我有兴趣,哪怕是一点点向后有时现实世界的项目学习。

I am a fairly "newb" Android developer, and I would like one of my first projects to be a live wallpaper, however I am conflicted on whether I should be focusing on Canvas or OpenGL for it. Being new to this I know I should master Canvas first since it is easier to use, but I prefer to learn from real world projects that I have an interest in, even if it's a little backwards at times.

我在非常基本的方式使用前后,我理解的一般概念给他们,但我不知道他们是如何转交给动态壁纸的境界。我想,是不是需要在一个活的壁纸OpenGL的完全成熟的速度,因为在最高的FPS运行它只是电池耗尽超过必要,但在同一时间,我很担心,使用Canvas会造成滞后和做事结结巴巴时,像改变主屏幕。

I have used both before in very basic ways, and I understand the general concepts to them, but I am not sure how they transfer over to the realm of live wallpapers. I figure that the full blown speed of OpenGL isn't required on a live wallpaper, since running it at max FPS would just run down the battery more than it necessary, but at the same time I am worried that using Canvas would cause lags and stutters when doing things like changing home screens.

我一直倾向于使用OpenGL ES 2.0,既能保持最佳性能,并因为我最初的想法壁纸涉及到很多层次感,我不知道Canvas是能够的,但我想一个比较有经验的开发人员意见是否所有涉及使用OpenGL(尤其是与动态壁纸,从我读过)额外的工作是值得的。

I have been leaning towards using OpenGL ES 2.0, both to keep performance optimal and because my initial ideas for the wallpaper involve a lot of layering that I am not sure Canvas is capable of, but I'd like a more experienced developers opinion on whether or not all of the extra work involved in using OpenGL (especially in relation to live wallpapers, from what I've read) is worth it.

推荐答案

如果你可以逃脱只是画在画布(在SDK如立方体的例子),这是少得多的工作。因为动画(无位图)的简单的,立方体是能够实现无困难高帧速率

If you can get away with just drawing to a canvas (e.g. cube example in SDK), that's much less work. Because of the simplicity of the animation (no bitmaps), the cube is able to achieve a high frame rate without difficulty.

如果你想使用OpenGL,则需要使用一个补充包,如GLWallpaperService,AndEngine或RenderScript。

If you want to use OpenGL, you will need to use a supplemental package, such as GLWallpaperService, AndEngine, or RenderScript.

http://www.rbgrn.net/content/ 354-glsurfaceview适应-3D-活壁纸

http://www.andengine.org/forums/教程/活墙纸模板t258.html

浏览Android源$ C ​​$ C怎么看股票壁纸(如草,银河)使用RenderScript实现。此链接的可以的工作,但没有保证:<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/4.1.1_r1/com/android/wallpaper/" rel="nofollow">http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/4.1.1_r1/com/android/wallpaper/ (然后向下滚动到壁纸)

Browse the Android source code to see how the stock wallpapers (e.g. Grass, Galaxy) are implemented using RenderScript. This link may work, but no guarantees: 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)

Moonblink已停止他的项目,但如果你真的渴望,你可以尝试研究自己的工作(基板)从这里开始: HTTP://$c$c.google.com/p/moonblink/source/browse/wiki/Setup.wiki

Moonblink has discontinued his project, but if you're really keen, you can try researching his work (Substrate) starting here: http://code.google.com/p/moonblink/source/browse/wiki/Setup.wiki

这篇关于Android的动态壁纸 - OpenGL的VS帆布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆