Demonstrate rhino-android library use with Android.
The point of this app is mainly to show the proguard configuration needed to build an application unsing rhino-android.
Branch a device or an emulator through ADB and run one of the two commands:
$ ./gradlew installDebug
$ ./gradlew installRelease
The main activity will switch on the keywords from which you can access the Rhino script engine.
Going to the point, the important part of this project is the proguard configuration.
We use R8 as the APK optimizer. If you have any issue with it, you can disable R8 to force the use of Proguard.
In this sample project, we had to disable the R8 compilation tool to make the Proguard configuration work and avoid shrinking too much classes.
The configuration disabling R8 can be found in the gradle.properies file.
With the latest version of the Android SDK tooling, R8 is now handling our rhino script engine as well as Proguard.