This question is based on my previous question: Android - set a notification so that you never leave
Now I understand that I need to start something at startup in order to trigger a notification.
From my previous question, it seems I can take two routes. Either start the service, or use BroadcastReceiver. I think that starting the service is a bit too much (but what I know). I am stuck walking the BroadcastReceiver route. It works in general, but when I take my code for notification, I get a bunch of errors.
This is my code:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher) .setContentTitle("My notification") .setContentText("Hello World!");
My mistakes: 
Any ideas on this?
Summary: Is a service or broadcast receiver better (in this situation)? How can I solve these errors in my code (when you hover over that they are undefined)?
EGHDK source share