I am working on the development of an SDK in Android with Java, In general the user doesn't need to inherit any class of the SDK, so the question is if it is a good practice put by default all classes as final in the SDK's Classes?
In general, unless you're specifically designing your classes to be inheritable, it's better to mark them
Here's why: you can't predict how someone might use your class. If you allow inheritance, your clients may use them (or break them) in unexpected ways. If you don't design the class specifically to be inherited, you may break their code when you update your classes.
Leaving classes unsealed means that someone who inherits the class has access to its internals. Effectively, these internals become part of your public API. So if you want to control your API surface, the class must be
Eric Lippert provides a detailed treatment of the subject here.
If another developer can change your class from final to non-final then marking it as final doesn’t mean “cannot be subclassed”, it means “I didn’t give the question whether it can or should be subclassed one second thought, if you subclass it then it is completely your responsibility”.
If that is the case, make it final.
If other developers cannot modify your class then final does prevent subclassing. Only make it final if subclassing must be prevented.