This project explores the migration of Scala applications to mobile platforms, inspired by and building upon the foundational work of Scala on Android. It serves as a demonstrative example, showcasing the integration of native services via Gluon Attach without the need for the Gluon Charm Glisten library. The application is developed entirely using free projects offered by Gluon and is available in two versions: Scala and Java, for comparative analysis.
The application offers two main functionalities:
-
Acceleration Data Visualization:
- Reads and displays acceleration data in a graph.
- Allows exporting the graph as a screenshot and the data as CSV files.
-
Audio Signal Generation:
- Generates Continuous Wave or Chirp signals.
- Plays the audio within the app.
- Saves the audio file in an external directory under "/Gluon".
The project contains two main directories, each hosting a version of the application:
Scala_App
: The Scala implementation.Java_App
: The Java implementation.
For Android and iOS, pre-packaged APK files are available, facilitating easy installation and testing. The iOS versions were created via GitHub Actions and are not fully tested due to the missing hardware. They are also only available for the iOS Simulator.
- For Android development there is the more detailed tutorial on prerequisities and installation steps on the Scala Website.
- The official Gluon Documentation gives a very detailed information on prerequisities and installation steps.
- Install Gluons Version of GraalVM
- gcc version 6 or higher
- ld version 2.26 or higher
- Recommended to use IntelliJ or NetBeans as IDE with the Scala and JavaFX Plugins
- Maven (In this Project I used version 3.8.8)
- For Android development, Linux is required
- For Linux: To install the required packages, run the following commands:
sudo apt-get install libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libfreetype6-dev
sudo apt-get install libgl-dev libglib2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libxtst-dev zlib1g-dev
- For iOS development, macOS is required.
-
Clone the repository: git clone https://github.com/thomas7b/ScalaOnMobile---Example-App.git
-
Navigate to either the
Scala_App
orJava_App
directory, depending on your development preference. -
Follow the Gluon Documentation instructions specific to your platform (Android/iOS) to build the native image and create the application.
Contributions to the project are welcome.