Results 1 to 2 of 2
- 07-12-2011, 07:22 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 9
- Rep Power
- 0
- 07-14-2011, 04:02 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
A stub is a piece of code that keeps the compiler happy by declaring all the right things but is missing the actual code you would write to implement actual behaviour.
Eg the following is a method stub:
The point is that you have to replace the comment with something meaningful. When you create an android project in Eclipse (or other IDE) a number of classes are created: again, they are class stubs and you have to complete them by filling in the actual code you want. (In particular a subclass of Activity might be created with the name you specify when you create the project.)Java Code:public int getCount() { // TODO: calculate the count and return it here return 0; }
handle is another general purpose word that means a "way of getting at something". In Java a more common word might be interface.
As far as Android is concerned Context is an abstract class that provides lots of methods - like getApplicationInfo(), getResources(), and especially startService() and startActivity() - which get information from the Android system or tell it to do something. For instance when you call startActivity() this tells the Android system the sort of thing you want to happen and the system will respond by launching some program or other that will carry out that intent.
Such an abstract class that provides methods for working with the system as a whole is described as "providing a handle" to the system.


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks