public class AstroboyRemoteControl
extends java.lang.Object
A class to control Astroboy remotely.
This class uses the current context, so we must make it @ContextSingleton.
This means that there will be one AstroboyRemoteControl for every activity or
service that requires one.
Note that we actually ask for the Activity, rather than the Context (which is
the same thing), because we need access to some activity-related methods and this
saves us from having to downcast to an Activity manually.
It also asks RoboGuice to inject the Astroboy instance so we can control him.
What you'll learn in this class
- What @ContextSingleton means and when to use it
- How to inject an Activity instead of a Context (which is really the same thing)
- How to use RoboGuice's convenient and flexible logging facility, Ln.