I am struggling to extend the android.hardware.Camera
class. My problem is that when I try to call the constructor I am having problems with the visibility. So I am wondering whether it is possible at all to do something like this:
import android.hardware.Camera
public class MyCamera extends Camera {
public MyCamera(Context context) {
super(context);
}
}
There are many ways to have an API that is "more understandable and less complex". Those objectives do not require inheritance. In some cases, inheritance may be a way to achieve those objectives, but inheritance is not the only solution. And, in some cases, like this one, inheritance has its own issues.
Use composition.
Since here is no constructor for
Camera
that is part of the Android SDK, you do not have much of a choice in the matter, if you want reliable code.