mirror of
https://github.com/FSO-PRICES/LIK-Preiserfassung.git
synced 2026-08-26 10:34:26 +00:00
Read-only mirror of https://github.com/FSO-PRICES/LIK-Preiserfassung — Swiss Federal Statistical Office - Prices. Issues & pull requests at the source.
- TypeScript 77.4%
- HTML 14.7%
- SCSS 6.5%
- JavaScript 1.2%
- PowerShell 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .vscode | ||
| apps | ||
| build-apk-in-container | ||
| data-preparation | ||
| libs | ||
| local-couchdb-setup | ||
| package-declarations | ||
| tools | ||
| .editorconfig | ||
| .envrc | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitignore | ||
| .npmrc | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| couchdb_permissions.ps1 | ||
| couchdb_permissions.sh | ||
| jest.config.ts | ||
| jest.preset.js | ||
| LICENSE.txt | ||
| migrations.json | ||
| nx.json | ||
| package-lock.json | ||
| package.json | ||
| preamble-gpl-license-text.ts | ||
| prepend-preample.md | ||
| README.md | ||
| tsconfig.base.json | ||
BFS/Lik - Studio
Node Version: 20.5.0
App Setup
- Clone Git Repo
git fetchnpm cinpm install --global nx@latest- Check if the apps are running
nx serve backofficenx serve preiserfasser
Capacitor Setup
cd apps/preiserfassernpm ci(didn't work for me, had to use npm i)- Add Android platform to the project
nx run preiserfasser:add:androidYes when asked if @capacitor/cli@5.0.3 should be installed - Is there an Android folder in apps/preiserfasser? Yes? Good.
nx run preiserfasser:generate-capacitor-assetsnx build preiserfassernx run preiserfasser:sync:android --preserveProjectNodeModules
Java Installation
- go to https://www.oracle.com/java/technologies/downloads/#jdk17-windows and install the msi-installer for windows
- Run
java -versionto make shure Java JDK is installed
Android Command Line Tools
- Install the android command line tools and platform-tools next steps are from here: https://proandroiddev.com/how-to-setup-android-sdk-without-android-studio-6d60d0f2812a
- download the Command line tools only from https://developer.android.com/studio
- create a folder structure in your programm-root like this: android/cmdline-tools/tools and unzip all into this folder. f.e. c:\programms\android... or somewhere else
- add an env-variable to windows
ANDROID_HOME=the path to the android folder you just created(not cmdline-tools) - add this to the path variable:
%ANDROID_HOME%\cmdline-tools\tools\binand%ANDROID_HOME%\plattform-tools(maybe not necessary) - open a new terminal and type sdkmanager, if you see something its good
- then:
sdkmanager --install "platform-tools"sdkmanager --install "build-tools;28.0.3"
Debug APK
- cd into the lik studio project, then
nx run preiserfasser:sync:android --preserveProjectNodeModules nx run preiserfasser:capacitor-debug-apk- it downloads missing android-sdk stuff and when it works you have an unsigned apk in apps/preiserfasser/android/app/build/output/apk/debug
SIGNED APK
- copy the keystore file into the root of the project
- copy the .env file with the KEYSTORE_PW into apps/preiserfasser
- add
%ANDROID_HOME%\build-tools\28.0.3to the path env-variable - run
nx run preiserfasser:capacitor-sign-apkand cross your fingers...
IMPORTANT WHEN EVERYTHING IS RUNNING
If using Directory.Documents or Directory.ExternalStorage, in Android 10 and older, this API requires the following permissions be added to your AndroidManifest.xml:
Yes, we are using this in the app, so we need to add this to the AndroidManifest.xml in the apps/preiserfasser/android/app/src/main folder
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />