-
Notifications
You must be signed in to change notification settings - Fork 101
Frameworks & Java8
Because we are currently supporting Android down to version 4.0.3 (API level 15), we cannot use the "new" Java8 features in the code shared between the Android and the PC version of the game. This affects the following submodules:
- go.graphics
- go.graphics.android
- jsettlers.common
- jsettlers.graphics
- jsettlers.graphics.androidui
- jsettlers.logic
- jsettlers.main.android
- jsettlers.network
In order to still be able to use lambda expressions and Java8 style streams, the frameworks retrolambda and streamsupport are used.
Retrolambda allows us to use "lambda expressions, method references and try-with-resources statements" by converting the compiled Java8 bytecode. As this step is automatically applied during compilation, you should not see any differences in comparision to using Java8 directly.
The streamsupport library offers the Java8 streams for non-Java8 users. However, as the library cannot change the API of the used Java version, the methods cannot always be used in the absolut same way. Therefore, I highly recommend to have a look at the Streamsupport "documentation".