NXT-Spy – Let’s go 2.1!

I realize that the reason why I have a very low frame-rate is because I am sending the images in their original format (5 megapixels), so It is really heavy to send over Wi-Fi. The problem is that the only function that is supposed to control the size of the image doesn’t work with my Callback function.

So I now really believe that I am working on a very buggy version of Android. So I am starting to look for a way to upgrade my phone to a higher version of Android, and unfortunately, even if an upgrade to Android 2.1 is available on HTC’s website, I cannot install it on my HTC Hero because I got it from Orange and so I have to wait for them to release the upgrade… And the problem is that, they are quite slow for this kind of things… So instead of waiting for a couple of month for the upgrade to be released, I decided to debrand it following this french tutorial [source]. As predicted, as soon as my phone got debreanded, I received the 2.1 upgrade.

Now that I have Android 2.1, I decided to get back to the preview callback method instead of the take picture that requires a loop that triggers the picture shot. And as predicted, my application doesn’t work anymore. Two problems that I had to solve :
– The preview size cannot be a custom size, it has to be one of the sizes given by getPossiblePreviewSize(). Which are for the HTC Hero :

  • width:1280, height:720
  • width:800, height:480
  • width:720, height:480
  • width:640, height:480
  • width:576, height:432
  • width:480, height:320
  • width:400, height:240
  • width:384, height:288
  • width:352, height:288
  • width:320, height:240
  • width:272, height:272
  • width:240, height:240
  • width:240, height:160
  • width:176, height:144

– The preview container has to be the exact same as the one set with setPreviewSize()

And it’s a success : As predicted, the setPreviewSize() bug is fixed on Android 2.1 and I now have a frame rate of a little bit bigger than 1 image/sec.

Leave a Reply

Your email address will not be published. Required fields are marked *