JME3 on Android with Camera

I started on a totally different task of running Berkelium within jME3 this weekend, which I had conceived of while talking to @normen and @pspeed … I ended up doing something which I deemed a bit more achievable, and much more fun :slight_smile:

So what we have here is a small jME3 application running on Android having its camera’s preview (a.k.a viewfinder) data put on a texture. It took a bunch of screaming on the Android SDK to first get at the camera’s preview buffers followed by a bit more tinkering to find a fairly efficient way of getting the image out to jME. Supposedly, a number of image formats are supported, but my HTC EVO evidently supports only one for its preview display (NV21, better known as YUV420). The YUV buffer is converted to a jpg which I put into a byte array and pass to a simple AssetInfo implementation that essentially wraps a ByteArrayInputStream.

The code is on GitHub (if you’re an Eclipse user, you’re in luck!)


1 Like

I made a jMonkeyEngine SDK project out of it and also fixed the careless multithreading :stuck_out_tongue:

Don’t know if or how it works because I have no android device.

awesome, thanks :slight_smile:

Hello @normen.
Where i can download this file “”?


@sbook thanks for your camera preview.But after installing in an android device(samsung Galaxy S5) it crashes and the error result is something related to openGL. May you guide me in this problem?