I'm working on a simple android live wallpaper, I'm following chapter 12 from Hello, Android as my guide.
The bare-bones of a wallpaper service looks like this:
public class MyWallpaper extends WallpaperService {
private class MyEngine extends Engine {
//...
}
//...
}
According to the book MyEngine
must be an inner class of MyWallpaper
. I have no reason to dispute this, but the book offers no explanation as to why this must be so. I prefer not to use inner classes purely for stylistic/aesthetic reasons.
I was wondering if MyEngine
actually has to be a private inner class and, if so, why?