tag:blogger.com,1999:blog-9675303.post8337981639703210820..comments2014-03-30T16:15:00.967+02:00Comments on Homebrew Coding: Lessons Learned with AndroidRichard Quirkhttp://www.blogger.com/profile/16290285494071462742noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-9675303.post-31303787397953806282011-06-06T09:35:27.760+02:002011-06-06T09:35:27.760+02:00@Adonis
I have the same problem (surfaceholder.lo...@Adonis<br /><br />I have the same problem (surfaceholder.lockcanvas takes too much time). Did you find any work around?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9675303.post-86505764106660170112011-02-21T13:58:33.588+01:002011-02-21T13:58:33.588+01:00wow, I tried open GL ES before but could not find ...wow, I tried open GL ES before but could not find a proper guide for it for 2D. and also 3 thread game architecture. so far all I know is the game loop which calls update and draw (with some draw/frame skips in case it's slowing down). do you have a tutorial for those stuffs you metioned? if so where's the link? thanks<br /><br />~Adonis Villamor<br />adonis_lee_villamor@yahoo.com.phAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9675303.post-39049971502794734362011-02-09T15:15:04.847+01:002011-02-09T15:15:04.847+01:00@Adonis I gave up looking at Canvas pretty much ri...@Adonis I gave up looking at Canvas pretty much right away. It is a real battery killer - even the Lander example provided by Google ran terrible on the emulator and a 1st gen phone.<br /><br />I use Open GL ES for rendering - check out the "native C" post, or see Chaos in the Market -, with the usual 3-thread approach: one thread for game logic, the main thread for Android system events (so the game is not force-stopped) and the standard GL rendering thread. It's conceptually more complex, requires a bit of thought to set up, but is closer to how games work on consoles.<br /><br />There's no locking this way, the GL thread calls "swap()" to swap the buffers when your rendering is done.Richard Quirkhttps://www.blogger.com/profile/16290285494071462742noreply@blogger.comtag:blogger.com,1999:blog-9675303.post-32059393136298671112011-02-09T13:54:53.574+01:002011-02-09T13:54:53.574+01:00Nice man! After testing android recently I have en...Nice man! After testing android recently I have encountered these stuffs you're stating. the worst however I've seen in androd dev is the number of milliseconds it takes to lock the surface handler of the surfaceview. <br /><br />You stated that it is recommended to run at 30fps, I agree and that is what I have been trying till now. I am wondering if you have really done it for the android.<br /><br />Lets say we just have a new simple app, no logic just fps reading...<br /><br />My understanding is we need this surfaceview where we will draw our graphics, texts etc. now on my gameloop i tried getting the system time, making note of the previous system time so I can get the ellapsed time using both values. with this i can see that update in a loop gets called so fast like 16k calls per second. <br /><br />now since i want to draw i need to call surfaceholder.lockcanvas which is a given in all tutorials online. now what happens in the ellapsed time is it fluctuates from 35 - 140ms in my emulator and 55-70ms in an 800mhz samsung ace. <br /><br />so how was it possible to get 30fps when just locking the canvas consume that much ms. to get 30 fps you'll need 33.33 ms per frame max for both 1 update and draw call assuming we do not skip frames.<br /><br />I'd like to hear from you about how you did it if ever. thanks man<br /><br />~Adonis Villamor<br />adonis_lee_villamor@yahoo.com.phAnonymousnoreply@blogger.com