Skip to content

scify/Dianoia-app

Repository files navigation

Dianoia - Ionic Mobile app


A demo of the app (in Greek) can be found here.

Non-pharmaceutical activities for people with dementia.

Pre-setup steps

It is very easy to install multiple versions of NodeJS and npm, by using Node Version Manager (nvm).

This project was built using the following versions of nodejs and npm:

nvm install lts/fermium # (or nvm install v14.21.1)

node -v
v14.21.1

npm -v
6.14.17

Alternatively, if you are using nvm, run this command in order to sync to the correct NodeJS version for the project:

nvm use

Install project dependencies:

$ npm install -g @ionic/cli@6.11.11 

$ npm install -g cordova@8.1.2

$ cd dianoia-app

$ npm install

$ ionic serve

Execution

Then, to run it in a real Android device, cd into dianoia-app and run:

$ ionic cordova platform add android@8.1.0

$ ionic cordova emulate android

Generating icon and splash screen for all platforms

Update the following files:

resources/icon.png

and

resources/splash.png

And then run

$ ionic cordova resources

To generate the icon and splash screen files for all platforms and dimensions. For more info read this page.

Building

How to change app version before building for release

The app has several places where the app version is defined. Change the following:

  1. In the config.xml file, change the android-versionCode parameter, as well as the version (widget tag).
  2. Change the version in package.json file.
  3. Change the APP_VERSION constant, defined in src/consts.ts file.

Building for Android

Java - Gradle

In order to build for Android, Java 1.8 is required, along with Gradle 4.4.1.

Verify your installations by running:

$ java -version

$ gradle -version

You will need Java version 1.8 on your system. If you have multiple versions of Java installed, you will need to update the current one by running:

$ sudo update-alternatives --config java

$ sudo update-alternatives --config javac

And selecting the correct one.

Firebase Analytics

Since the project uses Firebase Analytics, In order to build for Android you have to put the google-services.json file from Firebase Console to the root directory. The build process will then copy this file to the platforms/andorid/app directory.

Creating the platform files

In order to build the android platform, you will need the correct version of the cordova-android plugin:

$ ionic cordova platform rm android

$ ionic cordova platform add android@9.1.0

$ ionic cordova build android

The build command will generate a full Android project, located in platforms/android. This project can then be opened in Android Studio, in order to build and produce the .aap (bundle) or the .apk files.

If you want to build a release version:

$ ionic cordova build android --release

Signing the Android .apk

After the android project is built, you can either use Android CLI commands, or just open Android Studio, and sign the .apk or .aap (bundle) file.

Build for Browser

In order to generate a bundled directory that can be hosted as a web application, you need to add and build the browser platform:

$ ionic cordova platform add browser@5.0.4

$ ionic cordova build browser

If you want to reset the browser platform:

Automated way:

$ npm run build-browser

Manual way:

$ ionic cordova platform rm browser

$ ionic cordova platform add browser@5.0.4

$ ionic cordova build browser

This will generate a platforms/browser/www directory that can be uploaded to a server.

GitHub pages

In order to generate the docs directory that can be used from GitHub Pages, you need to run the following script:

$ npm run build-docs

This will generate the docs directory. (Note that this directory is and should be under Version Control).

License

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Copyright 2016

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Sponsors

Το project “Διάνοια” υλοποιείται από τη Μη Κερδοσκοπική Εταιρεία SciFY στο πλαίσιο του προγράμματος “Σημεία Στήριξης” που συγχρηματοδοτείται από το ΤΙΜΑ Κοινωφελές Ίδρυμα, το Κοινωφελές Ίδρυμα Ιωάννη Σ. Λάτση, τη φιλανθρωπική οργάνωση Hellenic Hope και το Ίδρυμα Μποδοσάκη.

Περισσότερες πληροφορίες για το έργο σε αυτόν τον σύνδεσμο.