I am coming from Objective-C where we don't have packages and namespacing.
Android has android.text.format.DateFormat which has static methods that return java.text.DateFormat instances (getLongDateFormat() and getMediumDateFormat() specifically).
Are these methods referred to as "static methods" or "class methods" or both interchangeably?
Looking at Android documentation, how am I suppose to know that the android.text.format.DateFormat methods return a java.text.DateFormat instance and not an android.text.format.DateFormat instance (returning an instance of the latter is what I initially expected)?
How do I import the necessary packages to be able to use both of these classes in my source?
Is it possible to write my implementation code this way:
DateFormat df = DateFormat.getLongDateFormat(this.getActivity());
mLabel.setText(df.format(mEvent.getDate());
The other way I would write it would be to use the full package names, but this seems unnecessary:
java.text.DateFormat df = android.text.format.DateFormat.getLongDateFormat(this.getActivity());
mLabel.setText(df.format(mEvent.getDate());
staticmethods would be consideredclassmethods. Most would just call them static, but they could also be called (in this case) "factory" methods. Which means, they are a static method which creates and returns an object for you to use.