Can somebody explain this to me please :
Intent intent = new Intent(Context, AlarmReceiver.class);
I never understood and I seriously think
What i understand by means of context is environment.In simple terms context is the surroundings of anything.So when you are using any form of context you have to decide that what should be the surroundings of the things for which you are using context.
For example if you want some data or field to remain through out the application you should define it in application class.
Now when you get application context in any of your components of your application,this field that you have declared in the application class will be in your context.Hence you can access it.
Same is true for all context type.
If you ever try using alertDialog in the service component by using context "this".Try this one and i bet you will surely get exception as "this" represent environment of service when used in it.And as it is background component we can't add window in that.Hence it will tell you the bad token exception.Which means token generated for surrounding view is not proper for alertDialog to display.
Hope this gives you brief idea what you want.