Friday, March 23, 2012

Less (CSS) - The dynamic stylesheet language

LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. LESS runs on both the client-side (Chrome, Safari, Firefox) and server-side, with Node.js and Rhino.

Agility.js - OOP Javascript with MVC

Agility.js is an MVC library for Javascript that lets you write maintainable and reusable browser code without the verbose or infrastructural overhead found in other MVC libraries. The goal is to enable developers to write web apps at least as quickly as with jQuery, while simplifying long-term maintainability through MVC objects.

Here are some tutorials.

Tuesday, March 13, 2012

Nexus S ICS Battery Drain Issue - Solved?!

I own a Google Nexus S for about a year.
As most of the Android fans out there, in December 2011 when the ICS update for Nexus S was released, I made the update. Me and 4 more friends. Unfortunately for me, I was the only one who experienced fast battery drain issue.
Since then I am waiting for another release from Google so I don't have to charge my phone every night. Nothing came up, I got a thought about reverting to Gingerbread and also give it a try. Since I had to root my phone, I have tried different ROMs but ended up by going back to ICS. Nothing good happened.
Last week I was experimenting Flash Builder's mobile apps development so I had to turn on USB debugging on my mobile. This way I got acknowledge about other features that you can turn on under "Developer options" menu (System Settings > scroll at the bottom of the list > Developer options) like: Strict mode enabled, Pointer location, Show touches and more. I have turned on some options and continued with my app development.

Beside the nice impression about developing mobile apps using Flash Builder I have made an interesting discovery: my battery last longer!

So I switched my research from Flash Builder mobile apps development to Nexus S battery drain issue. I have made some test by turning features on and off from "Developer options" menu and as I am writing this post my Battery status shows:

There is a huge improvement in battery usage than before. The "Android OS" and "Android System" items used to be first and second in the list and usage time was no more than 24 hours. 
From the last charge my WiFi, GPS, autosync are turned on.

I am still trying different combination of features turned on or off but I have to wait for the phone to discharge so I can have a correct Battery status.
The drawback is that I have got about 2 phone restart without even touching the phone.

Right now my turned on features are:
  • Strict mode enabled (Flash screen when apps do long operations on main thread);
  • Force GPU rendering (Use 2D hardware acceleration in applications);
  • Show all ANRs (Show App Not Responding dialog for background apps).
At the first look those options does not have any direct connection with the battery (maybe the second one) but seems to do the trick. I will try more configurations and let you know.
In the mean time you can try it out by yourself and post your comments.
I hope it will work out for everyone and I am waiting for your feedback.

Update March 19, 2012

Here are some screenshots with only the following features turned on:
  • Force GPU rendering (Use 2D hardware acceleration in applications);
  • Show all ANRs (Show App Not Responding dialog for background apps). 

On the next cycle I will leave checked only Force GPU.