Cancelled due to client's disappearance.
front- the frontend part of the project. It is a vite JS+Rust(WASM) app.app- an Apache Cordova app that wraps the frontend part into a mobile app.
TODO: consider preparing a Docker image with the development environment.
- Navigate to the directory where you want to keep the directory with the project:
cd .../path/to/your/directory- Ensure you have
gitinstalled:
git --version- Clone the project:
git clone https://github.com/JohnScience/betting_app- Navigate to the directory with the project:
cd betting_app- Ensure you have
npminstalled:
npm --version- Install the JS dependencies for both the frontend and the app:
cd app && npm install && cd ../front && npm installrustc --version
wasm-pack --version-
Ensure you have Android Studio installed.
-
Ensure your
ANDROID_HOMEenvironment variable is set to the path to your Android SDK directory, e.g.C:\Users\USER\AppData\Local\Android\Sdk.
# On Windows
echo %ANDROID_HOME%
# On Linux/MacOS
echo $ANDROID_HOME-
Ensure that you have the Android tools in your
PATHenvironment variable:ANDROID_HOME/tools,ANDROID_HOME/tools/bin,ANDROID_HOME/platform-tools.
Satisfying Gradle's Compatibility Matrix can be difficult because, at the time of writing this, it paints a too optimistic picture. The latest Gradle (8.3) doesn't support the latest JDK version (20). You can use the tools that works for you but the following setup is known to work:
-
Ensure you have JDK of version
Amazon Corretto 19.0.2installed. To do that, you can open Android Studio and navigate to File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JDK. Screenshot. If there's no menu where you can pick a Gradle JDK, you might need to create a new dummy Android project first. -
Add the path to
Amazon Corretto 19.0.2JDK (e.g.C:\Users\USER\.jdks\corretto-19.0.2) toJAVA_HOMEenvironment variable.
# On Windows
echo %JAVA_HOME%
# On Linux/MacOS
echo $JAVA_HOME- Add
JAVA_HOME/binto yourPATHenvironment variable.
javac --version-
Ensure you have Gradle 7.6 installed at
<...>/.jdks/../.gradle/wrapper/dists. The directory is likely to be calledgradle-7.6-all. If it is not there yet, you can install it from https://gradle.org/releases/ and put there (for convenience). -
Ensure you set
GRADLE_HOMEto the path of your gradle binaries (e.g.C:\Users\USER\.gradle\wrapper\dists\gradle-7.6-all\9f832ih6bniajn45pbmqhk2cw\gradle-7.6). Note that the structure of the directory that was produced by Android Studio also contains a directory whose name is a hash. -
Add
GRADLE_HOME/binto yourPATHenvironment variable.
gradle --versionPicking the right version of Android SDK and NDK can also be tricky. The following setup is known to work:
-
Open Android Studio and navigate to Tools -> SDK Manager -> Languages & Frameworks -> Android SDK -> SDK Platforms. Even though Cordova currently imposes
android:minSdkVersionof24andandroid:targetSdkVersionof33, you have to ensure that onlyAndroid SDK platform 33underAndroid 13.0 ("Tiramisu")is checked. Screenshot. -
Change the tab from
SDK PlatformstoSDK Toolsand checkNDK (Side by side)of version25.0.8775105. TODO: consider choosing a newer version of NDK. -
Click
Applyand wait for the SDK and NDK to be installed. -
Set
NDK_HOMEenvironment variable asANDROID_HOME/ndk/25.0.8775105.
# On Windows
echo %NDK_HOME%
# On Linux/MacOS
echo $NDK_HOMEChange directory to the front where nearly all the work will be done:
cd frontAssuming you have the dependencies installed, you can tweak the frontend part and see the changes.
npm run devOnce you are happy with the changes, you can build the frontend part for testing it on a mobile device:
npm run test-on-<android|ios>TODO: add iOS target, possibly via cordova-ios, and check if it works as intended.
Note: testing on a mobile device takes more than a minute.
