Google I/O 2010 - Writing real-time games for Android redux
Why Stack Overflow recommends it
Stack Overflow users link it when answering Android game questions about OpenGL ES versus Canvas, sprite performance, texture compression, GL context loss and avoiding garbage collection.
Recommended by 16 people across 16 different months, 2010 to 2025.
What it is
Chris Pruett of Google presents a crash course in Android game development at Google I/O 2010, covering 2D and 3D games, performance benchmarks, device hardware differences, using C++ via the NDK, and traits of popular Market games. It is a follow-up to his 2009 talk and draws on his experience building the open-source game Replica Island.
What people said
Strong rec Dalmas · 2011-11 · Stack Overflow · on “Android canvas with GPU”
If you're not familiar with OpenGL for android, there is this excellent video [this video] . You'll learn the basics, somme common mistakes, how to write very fast code, ... and there is a link to some samples (which I don't remember).
Recommends Darius · 2010-07 · Stack Overflow · on “Android, iPhone, Symbian and Windows Mobile development learning material”
I found the Android Developers website very useful [LINK] I am fairly new to Android myself, but I dissected and annotated their LunarLander example so I could build a framework for my game from it and so far so good! If you have the time aswell check out Chris Pruetts talk from Google IO, I love this guy! [this video] Hope this helps
Recommends dwerner · 2010-08 · Stack Overflow · on “Avoid internal getters/setters - Game”
Any method call to set a scalar value is going to have overhead on the call stack, so just make all your members public. It breaks encapsulation, and the Java mentality of hiding members, but it makes for faster code. This example still shows a method call for assigning two variables. That's 2x as fast as the original setters, but still slow. See these talks for more info on developing games in java on android: [LINK] [this video]
Recommends aprock · 2010-09 · Stack Overflow · on “What common texture compression, if any, is available on the Android platform?”
There is no common format, because of hardware variations. Supported texture formats depend upon the OEM. Google I/O 2010 - Writing real-time games for Android redux [this video] , has a small section discussing texture compression. At about 6:55 he talks about texture compression options. ATITC: Nexus One (Qualcomm), and most widely used atm PVRTC: Droid (PowerVR) ETC1: The emerging standard Chris recommends ETC1, but also didn't compress his textures for the sample game.
Recommends Thomas · 2011-02 · Stack Overflow · on “How to detect when textures are destroyed”
When doing OpenGL on Android, I highly recommend that you watch these [LINK] two [this video] Google I/O talks by Chris Pruett, Android advocate, who wrote the open-source game Replica Island [LINK] . Here [this video] he talks about the exact problem you're seeing. Long story short: you don't detect when your textures (and buffers) are destroyed, but you detect when they need to be recreated. And this is exactly what the onSurfaceCreated [LINK] callback is for: Since this method is called at the beginning of rendering, as well as every time the EGL context is lost, this method is a convenient place to put code to create resources that need to be created when the rendering starts, and that need to be
Recommends Kingpin · 2011-02 · Stack Overflow · on “How to use OpenGL ES 2.0 in Android SDK ( not NDK)?”
You should check out this video [this video] . The guy goes over device support for different OpenGL ES versions and shows you how to get started with OpenGL on the Android. He also talks about the fragmentation of devices and how you can support them. Basically most "2nd generation" devices support 2.0 and have been shipping since late 2009. If you're going to target just 2.0 devices then you'll obviously have to do a system check to make sure device X has the proper hardware specs. If you want to see how to setup a basic OpenGL renderer in the SDK jump to 21:00 in that video.
Recommends Rajavanya Subramaniyan · 2011-02 · Stack Overflow · on “Android OpenGLES - Lag between calls to OnDrawFrame on Moto Droid at large resolution”
You have to give more information. If its not because of drawing, then it should be because of any calculation or object allocation code. Allocating Objects often during a game, invokes the GC, which is bad for games. Things about performance and allocating memory for Android games is explained in the links below. I suggest you watch these 2 videos done by Google Android Group. [LINK] [this video] Hope that helps in optimizing.
Recommends Wroclai · 2011-03 · Stack Overflow · on “Android: Deciding between SurfaceView and OpenGL (GLSurfaceView)”
All I can say is that it depends on how many sprites you're gonna use. Chris Pruett from Google has also documented this part very well. Google I/O 2009 [LINK] and Google I/O 2010 [this video] . Below is a picture from one of his slides that are related to your topic: With that knowledge, you should go with OpenGL using the draw_texture extension. Remember to query out the string and check if draw_texture is supported on the actual device. For further information that are related to game development in general, see this [LINK] .
Recommends Wroclai · 2011-03 · Stack Overflow · on “Writing real time opengl-es game for android - some question (optimizing)”
TIMING in a game: Is there a way to use other then System.Currentmillis()-starttime>XX to update anything in a game? Is it safe or CPU expensive? You should use a time delta system. There are a lot of tutorials about this. This is a very good tutorial: deWiTTERS Game Loop [LINK] . In my game I have 20 items (moving square vertexes), when it comes up to 60-70 vertex, the FPS drop down to 30-40 FPS, from 60 FPS. (testing on a galaxy S i9000 phone). Is there a way to my game FPS will be 30FPS? Is it good for update my game to 30 FPS, or I dont need to handle this? (because there will be a lagg on lower FPS - it will be slow) That's depending on which method you're using. If 3D, you should consi
Recommends Patrick Kafka · 2011-05 · Stack Overflow · on “Android 2D game programming: using OpenGL or not?”
OpenGL ES all the way! There are some good videos from last years IO on android game dev and the frame rates you can achieve going opengl vs canvas. [this video] [LINK] Also there are a handful of great 2d frameworks to simplify the process, the best in my opinion being AndEngine [LINK]