Uncategorized

2013 in review

Posted on

The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 10,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 4 sold-out performances for that many people to see it.

Click here to see the complete report.

Service- Does it serves as a background thread?

Posted on Updated on

Services are one of the important application components in Android that helps to execute long running operations in background. In fact what I thought was, Services would execute as a background thread without interrupting the main thread. But soon I found that my assumption was wrong, in fact Service also run in the main thread of the application  where the UI operations occur. Therefore, if we perform a long task in onStartCommand() method, it will block the main thread the end result is, unresponsive application . So to avoid the problem, you have to execute the complex task into a separate thread. this can be achieved with the help of

  • Asynctask
  • Declaring seperate Thread

Additionally there two memory management techniques as well. Declaring the return statement in onStartCommand() method.

START_STICKY: Notifies the OS to recreate the service after it has enough memory and call onStartCommand() again with a null intent.

START_NOT_STICKY: Notifies the OS  not to recreating the service again.

2012 in review

Posted on

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 7,100 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 12 years to get that many views.

Click here to see the complete report.