There are two solutions to your question that don’t involve keeping all classes in the same package.
The first is to use the Friend Accessor/Friend Package pattern described in (Practical API Design, Tulach 2008).
The second is to use OSGi.
More Related Contents:
- android studio app running on api level 23 but crashes on 19
- How to connect with Web Api Spotify (in Java)?
- Singletons vs. Application Context in Android?
- Why is volatile used in double checked locking
- How to secure an API REST for mobile app? (if sniffing requests gives you the “key”)
- What are static factory methods?
- Real World Example of the Strategy Pattern
- Design Patterns: Factory vs Factory method vs Abstract Factory
- Long list of if statements in Java
- Double Checked Locking in Singleton
- Use Cases and Examples of GoF Decorator Pattern for IO
- Is there a Java equivalent or methodology for the typedef keyword in C++?
- Java: How do you convert a UTC timestamp to local time?
- I need an alternative option to HttpClient in Android to send data to PHP as it is no longer supported
- Why implementing a Singleton pattern in Java code is (sometimes) considered an anti-pattern in Java world?
- Java JSON serialization – best practice
- Other Ways of Singleton in Java [duplicate]
- Open Session In View Pattern
- Builder Pattern and Inheritance
- PrintWriter and PrintStream never throw IOExceptions
- Is there a recommended way to use the Observer pattern in MVP using GWT?
- Why does every object in Java implicitly extend java.lang.Object class?
- How to change method behaviour through reflection?
- Is This Use of the “instanceof” Operator Considered Bad Design?
- How do you make an S3 object public via the aws Java SDK?
- Why people use message/event buses in their code? [closed]
- Singleton pattern (Bill Pugh’s solution)
- Checking for Power Saver Mode programmatically
- Template design pattern in JDK, could not find a method defining set of methods to be executed in order
- Cannot connect to localhost API from Android app