Posts

Showing posts from May, 2013

Push Notifications

Image
A notification in a message you can display to the user outside of your application's normal UI. When you tell the system to issue a notification, it first appears as an icon in the  notification area . To see the details of the notification, the user opens the  notification drawer . Both the notification area and the notification drawer are system-controlled areas that the user can view at any time. System will also display the notification as a TOAST when user is logged-in along with increment in the notification drawer. Lightweight Event Driven Notification System 1.1      Event Generation The event generation phase happens while processing the response to a user request. As such, we wanted to ensure that there was little or no impact on the response times from where notification is called/generated. To ensure this was the case, all we will do is store the minimum amount of data possible/lightweight message on the queue. We store the min...

Magical Final - Expanded Usage

Image
Most of us are aware of keyword final in java for the following: Prevent Inheritance by declaring class as final. Prevent method overriding by making method as final. Declaring constants. I am here to let know more advantages of keyword 'FINAL' which are not generally aware of: More about Final Constants. Conditional Compilation More About Final Constants Primitive (int, char, float etc) other than arrays are substituted at compile time with their values, if you change a final that is used by other classes, you must remember to recompile those other classes or your change will not take effect. The same rule applies to constants of type java.lang.String . Although String is a constructed type, it is also substituted at compile time. All constructed types other than String , mutable or not, are not substituted at compile time. To understand how this works Consider the following code fragment: package com.dapinder.practice; public class FinalCo...