Edit: checking for current API:
int currentVersion = android.os.Build.VERSION.SDK_INT;
int honeycombVersion = android.os.Build.VERSION_CODE.HONEYCOMB;
if (currentVersion >= honeycombVersion ){
// Use Notification.Builder
} else{
// Use Notification(int, charSequence, long)
}