2

as a title how to start creating android games? Is there any sample code for android games creation , what graphic library used ?

Thanks.

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
Conex
  • 832
  • 8
  • 17

6 Answers6

9

There are basically two graphics systems for Android. Canvas, which is not hardware accelerated (all stuff is done by the CPU).

The more powerful and hardware accelerated alternative (if you're using it correctly) system is OpenGL. Google has done a very good work on wrapping the OpenGL system into one basic view, which is GLSurfaceView.

However, you should start looking at the Sample API demos, where the Lunar Lander demo is a great start. If you're already going hardcore and want to learn about the OpenGL system, the SpriteMethodTest is a good start, created by Chris Pruett, which also has done an open source project called Replica Island.

If you're intersted in some other resources about games, see:

Community
  • 1
  • 1
Wroclai
  • 26,835
  • 7
  • 76
  • 67
6

Android graphics overview: http://developer.android.com/guide/topics/graphics/index.html

3d graphics intro: http://developer.android.com/guide/topics/graphics/opengl.html

2d graphics intro: http://developer.android.com/guide/topics/graphics/2d-graphics.html

As for general gaming development, you should read up on fundamentals before trying to make games on it. It is quite different to program on mobile platforms. http://developer.android.com/guide/topics/fundamentals.html

A couple game examples:

JetBoy: http://developer.android.com/resources/samples/JetBoy/index.html

LunarLander: http://developer.android.com/resources/samples/LunarLander/index.html

Snake: http://developer.android.com/resources/samples/Snake/index.html

JClaspill
  • 1,725
  • 19
  • 29
  • http://developer.android.com/resources/browser.html?tag=gamedev is something you can bookmark incase they release more articles/samples/tutorials later. – JClaspill Mar 22 '11 at 21:55
2

It's kind of a vague question, since there is everything from word games to first-person shooter games. Have you looked at the Lunar Lander sample project?

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
1

You can use the Canvas provided by the method onDraw of an View to draw 2D graphics. Sometimes it's enough for an game.

You can also use OpenGL ES to hardware accelerated drawing.

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
1

It sounds to me like you're looking for something more like App Inventor which abstracts a ton of programming for the creator at the cost of flexibility.

eternalmatt
  • 3,524
  • 4
  • 25
  • 25
0

Well... I was also very keen to making android games as a hobbist.... as I proceed with my research... I found that there are many nice open frameworks available for this purpose, I highly recommend LibGDX for making android games. This is mostly java based but ports your game for Desktop, Android as well as iOS.

Vishal Kumar
  • 4,419
  • 1
  • 25
  • 31