Meaningless Drivel is fun!*
The moose likes Android and the fly likes What are the best practices to follow while developing a game in Android ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "What are the best practices to follow while developing a game in Android ?" Watch "What are the best practices to follow while developing a game in Android ?" New topic
Author

What are the best practices to follow while developing a game in Android ?

amol l chavan
Greenhorn

Joined: Apr 11, 2011
Posts: 1
Hi,

I want to know what are the best practices to follow while developing a game in Android ? And I also wanted to know do I need knowledge about C++ also?




Amol L. Chavan

Mario Zechner
author
Ranch Hand

Joined: May 06, 2011
Posts: 47
Let me start with your second question: no, you don't need to know C++ to write games for Android! You can get along with Java just fine. For complex physics calculations you have to go native, but there exist JNI wrappers already so you can still stay in Java.

Answering your first question is a tough cookie. Let me try to cover at least some essential aspects:

- On Android you have to make sure to cooperate with the garbage collector. This means that you should avoid allocations of new obejcts in your main loop as good as possible.
- You should avoid draining the battery by only enabling sensors like the accelerometer if you really need them.
- Your game should respect the life cycle of an Android Activity: pausing and resuming have to be implemented so that users can get back to the game and pick up from where they left.

There are many more aspects you should give some thought, however, these mostly depend on the APIs you use for creating the game, such as OpenGL ES. Explaining them all in here would be a bit to much


Book: "Beginning Android Games" Blog Twitter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What are the best practices to follow while developing a game in Android ?