Monday, March 15, 2010

Blog audience 1T10

Since 2009 December, 15 this blog had 241 visits from 59 countries.

Visiting countries from 2009 December, 15 to 2010 March, 14

The top 10 countries are:


  • Brazil: 37

  • India: 22

  • United States: 18

  • Indonesia: 12

  • Romania: 8

  • Germany: 8

  • United Kingdom: 6

  • Sweden: 6

  • Portugual: 5

  • Canada: 5



Poland, Turkey and Russia has left the top 10 list. New to the list are Indonesia, Romania and Canada.

Related topics:

Saturday, March 13, 2010

Adapting to sizeChanged

Cell phones with accelerometers may automatically change the screen orientation from portrait to landscape.
If you use LCDUI screens on your application there is nothing to worry.
But if you use Canvas these changes are notified by sizeChanged method.

At my Books application I show text in fullscreen landscape.
The user will need to rotate the handset to read properly.
If the cell phone automatically change the screen orientation the user will not be able to read.

What I had to do is to implement sizeChanged method to check if Sprite rotation is needed or not:


public void sizeChanged (int w, int h) {
if (sprite == null) return;
if (super.getWidth() < super.getHeight()) { // portrait screen
sprite.setTransform(Sprite.TRANS_ROT90);
} else {
sprite.setTransform(Sprite.TRANS_NONE);
}
sprite.setPosition(0, 0);
}

Related Topics: