Creating a Java module
On top of this template project, we want to add another module of code. This will be a Java-only module and will act as a dependency or library, if you will, for our main Android module.
The idea here is two-fold. First, it allows you to separate code that is Java only, and does not have a dependency on Android, in a big project this can be your core domain; the business logic that runs your app, and it is important that you modularize this, so you can work on it without having to think about Android as well.
Secondly, having a Java-only module as we've said before, allows you to call on the vast history of Java as an established programming language when it comes to testing. Testing of the Java module is fast, simple, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access