Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I did some research and a found Box2d. I then proceeded to download it and the testbed. Now that i have it, I don't know how to properly use it. I'm looking for a clear simple answer on how to use the engine.

The things I did was that I put it into a lib folder and referenced the JBox2D jar file. After that i got stuck. How can i use this to program games for android?

I'm very confused since Box2d was intended for C++.

share|improve this question
up vote 2 down vote accepted

I've just started using libgdx ( for Android development. They have a JNI wrapper for Box2D (java wrapper for the native code). They also have plenty of example code which you can look at to see how they use Box2D.

If you view the video at their Google code page, it will explain how to easily setup a project. Then you may want to go to the wiki, or I found that the guy at is working his way through an extremely comprehensive but easy to understand tutorial.

If you are interested in looking straight at some Box2D code which runs on Android, here are plenty of tests here:

There is also source code for complete games, some which use Box2D:

You'll find development quite fast, because you can run your games on a PC as well as on the phone, so most of your debugging will be done on the PC. The process for setting up both the PC and the Android code is described nicely in the video I described above (the guy narrating is quite funny).

share|improve this answer
Hmmm, I realise that I sound like a salesman here, but I'm not affiliated with them. Haven't made any contributions (yet) and am not actually all that experienced with this particular library (yet). I just quite like the cut-of-their-jib. – Peter Serwylo Mar 21 '12 at 12:07
This does not help with the original question. Are there any JBox-2D tutorials that you know of? – Mar 3 '14 at 17:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.