Skip to content

{ Category Archives } Uncategorized

Floating point exact representation of integers

There are two main floating point formats: single-precision (float in Java) which stores a value in 4bytes, and double-precision (double) using 8bytes. The question is what range of integers can be represented exactly by these floating point formats? In other words, what is the maximum value for which such a statement holds: long v; (long)(float) [...]

Apple is bad

I’ll never buy an Apple product again. I find the patent situation in the US profoundly sick. Microsoft is making money on the back of Android with patent fees. Apple and Microsoft team up together to buy the Nortel patents for 4.5billion, to be used against competitor Android. Apple suing HTC and Motorola over Android. [...]

RenderFX: color vs. power

Android render effects is a way to globally change the colors used when rendering, for example by using only the Red channel (disabling Green and Blue). It was first presented on Jeff Sharkey’s blog, and it is now implemented and available in CyanogenMod. Instead of using the three color channels (RGB) you may chose to [...]

Cyanogen Rules

I use a Nexus One phone. I have been using it for more than one year. I’ve written apps for it. Yet until yesterday I didn’t know it has an FM receiver. Yes, the Nexus One has a perfectly good functional FM receiver. The hardware (FM radio) is there in the phone. It’s just that [...]

How to work around Android’s 24 MB memory limit

The Android framework enforces a per-process 24 MB memory limit. On some older devices, such as the G1, the limit is even lower at 16 MB. What’s more, the memory used by Bitmaps is included in the limit. For an application manipulating images it is pretty easy to reach this limit and get the process [...]

Nexus One display: 16 or 24 bits per pixel?

There has been some discussion recently about whether the Nexus One display panel hardware has 24 bits per pixel or 16 bits per pixel. 24bpp means 8 bits per color RGB888 and allows a total of about 16 million different colors. 16bpp is RGB565 (Red and Blue have 5 bits and Green has 6 bits), [...]

Android: OpenGL ES screenshot

Here is how you can get a .png screenshot of an OpenGL image on Android: // GL10 gl; // int width, height; int size = width * height; ByteBuffer buf = ByteBuffer.allocateDirect(size * 4); buf.order(ByteOrder.nativeOrder()); gl.glReadPixels(0, 0, width, height, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, buf); int data[] = new int[size]; buf.asIntBuffer().get(data); buf = null; Bitmap bitmap = Bitmap.createBitmap(width, [...]

Android application backwards compatibility

Say you are an Android application developer. You have a last-generation Nexus or Droid phone, and you use for development a recent Android SDK version 2.1. Yet more than a half of your potential users have older phones with older versions of Android: 1.5 (Cupcake) or 1.6 (Donut). You can simply ignore the not-up-to-date user [...]

The free AppEngine: how much does it cost?

AppEngine is a Google product that allows to write web applications in Python or Java and host them on the Google infrastructure. AppEngine takes care of the typically difficult tasks of distribution, scalability and fail-over. It offers easy to use APIs for web request handling, data storage, memcache, etc. One of the biggest benefits is [...]

Nexus One display and subpixel pattern

According to the Nexus One specs, it has a 800×480 AMOLED display. According to Wikipedia, this is what makes an AMOLED display different from standard LCD: It does not need a backlight, the pixels emit light themselves. This allows for thinner display. Only the turned-on pixels consume power. In average AMOLED uses less power than [...]