In the Android AAR library, can I open an open API and hide the implementation?

This seems like such a basic question, but I cannot find the information anywhere.

I would like to create an AAR that provides a public API, but hides the implementation, so that the implementation will not be called directly.

I see no way to do this otherwise than obfuscating the packages that I want to encapsulate (hide).

+4
source share
1 answer

The solution I came across is to expose my API through a factory that always returns interfaces. Each interface contains only those methods that I want to set.

, , , , .

0

All Articles