Git Product home page Git Product logo

more-app-multiplatform's Introduction

More App Multiplatform

This document provides detailed description of how to install, prepare and contribute to the App development as part of the "MORE"-Project.

Getting Started

This is an example of how you can set up the project locally. To get a local copy up and running follow these steps.

Prerequisites

The following prerequisites list contains all the needed software in order to be able to build the app locally.

Disclaimer: To write iOS-specific code and run an iOS application on a simulated or real device, you'll need a Mac with macOS. This cannot be performed on other operating systems, such as Microsoft Windows. This is an Apple requirement.

It's recommended that you install the latest stable versions for compatibility and better performance. In order to build the iOS application the version of iOS should be at least 14.

Also, it's recommended to install the following plugins in the Android Studio directly:

Kotlin Multiplatform Mobile - In Android Studio, select Settings/Preferences | Plugins, search Marketplace for Kotlin Multiplatform Mobile, and then install it.

Kotlin plugin - The Kotlin plugin is bundled with each Android Studio release. However, it still needs to be updated to the latest version to avoid compatibility issues.

To update the plugin, on the Android Studio welcome screen, select Plugins | Installed. Click Update next to Kotlin. You can also check the Kotlin version in Tools | Kotlin | Configure Kotlin Plugin Updates. The Kotlin plugin should be compatible with the Kotlin Multiplatform Mobile plugin. Refer to the compatibility table.

Installation

The following is an instruction on how to install and configure the project on your local device.

  1. Clone the repo:
    git clone https://github.com/MORE-Platform/more-app-multiplatform.git
  2. Open the project in Android Studio.
  3. Make sure to sync project with the Gradle Files. Click File | Sync Project with Gradle Files and wait until it's done.
  4. Now we can build the project. Go to the terminal and perform the following command in the root folder of the project:
    ./gradlew build
  5. Now you should be good to go. You can create an emulator device and start your application.

Troubleshooting with KDoctor

To make sure everything works as expected, install and run the KDoctor tool:

  1. In the Android Studio terminal or your command-line tool, run the following command to install the tool using Homebrew:

    brew install kdoctor

    If you don't have Homebrew yet, install it or see the KDoctor README for other ways to install it.

  2. After the installation is completed, call KDoctor in the console:

    kdoctor
  3. If KDoctor diagnoses any problems while checking your environment, review the output for issues and possible solutions:

  • Fix any failed checks ([x]). You can find problem descriptions and potential solutions after the * symbol.
  • Check the warnings ([!]) and successful messages ([v]). They may contain useful notes and tips, as well.

You may ignore KDoctor's warnings regarding the CocoaPods installation. In this project, we use Swift Package Manager and not CocoaPods.

Usage

Emulator Configuration

In order to run your application you have to create an emulator device. Follow these steps to create an Android emulator:

  1. Click Device Manager in the upper right corner, right next to the build symbol.
  2. Click Create device.
  3. Choose the device you would like to use as an emulator. Important: The device should have Play Store support! You can see it by the device being marked with a Play Store icon.
  4. Choose a system image. It's recommended to use the Tiramisu release with the API Level 33.
  5. Next verify configuration and the installation of the image will begin immediately.
  6. Now you are all set to run your application on the configured Emulator!

Running the App

After you have configured the emulator device for your project, you can run the application, which will start the emulator and install your application on it. After that you can use the emulator to test the app.

Because More App Multiplatform supports iOS and Android, you can choose which application and the corresponding emulator you want to run.

Android App

  1. In the Run Configurations choose androidApp.
  2. In the Available Devices choose your configured Emulator Device.
  3. Press Run arrow.

iOS App

  1. In the Run Configurations choose ios App.
  2. Press Run arrow.

Project Architecture

The purpose of the Kotlin Multiplatform Mobile technology is unifying the development of applications with common logic for Android and iOS platforms. To make this possible, it uses a mobile-specific structure of Kotlin Multiplatform projects.

To view the complete structure of your mobile multiplatform project, switch the view from Android to Project.

Root Project

The root project is a Gradle project that holds the shared module and the Android application as its subprojects. They are linked together via the Gradle multi-project mechanism.

App architecture

The iOS application is produced from an Xcode project. It's stored in a separate directory within the root project. Xcode uses its own build system; thus, the iOS application project isn't connected with other parts of the Multiplatform Mobile project via Gradle. Instead, it uses the shared module as an external artifact – framework. For details on integration between the shared module and the iOS application, see iOS application.

The root project does not hold source code. You can use it to store global configuration in its build.gradle(.kts) or gradle.properties, for example, add repositories or define global configuration variables.

Shared Module

Shared module contains the core application logic used in both Android and iOS target platforms: classes, functions, and so on. This is a Kotlin Multiplatform module that compiles into an Android library and an iOS framework. It uses the Gradle build system with the Kotlin Multiplatform plugin applied and has targets for Android and iOS.

plugins {
    kotlin("multiplatform") version "1.8.10"
    // ..
}

kotlin {
    android()
    ios()
}

Sources sets

The shared module contains the code that is common for Android and iOS applications. However, to implement the same logic on Android and iOS, you sometimes need to write two platform-specific versions of it. To handle such cases, Kotlin offers the expect/actual mechanism. The source code of the shared module is organized in three source sets accordingly:

  • commonMain stores the code that works on both platforms, including the expect declarations
  • androidMain stores Android-specific parts, including actual implementations
  • iosMain stores iOS-specific parts, including actual implementations

Troubleshooting

  • Use Wipe Data on your emulator device.
  • Use Sync Project with Gradle Files in the File tab.
  • Use Invalidate Caches in the File tab.

Operating System Management of MORE Apps

As the mobile phone operating systems are attempting to limit unintended application data access and background activities for privacy and battery preservation, as well as for overall performance reasons, please consider checking through operating system settings that:

  • MORE can run without battery saving limitations as a background application
  • Access to the required sensing APIs is available (particularly GPS, accellerometry and wider physical activity according to your study needs) and ideally not limited to episodes of active (foreground) application use only
  • If pairing with further sensing devices is intended, please assure that Bluetooth is enabled with appropriate access rights and consider resetting the connection or manually linking devices through operating system functionalities if the integrated pairing in MORE fails

Useful links

License

Apache 2.0 with Commons Clause; see LICENSE.txt for further details

Contact

Ludwig Boltzmann Institute for Digital Health and Prevention - more-health.at - [email protected]

more-app-multiplatform's People

Contributors

alireza-dhp avatar andresgruber avatar dan0bar avatar drtyyj avatar iaigner avatar ja-fra avatar janoliver20 avatar juliamayrhauser avatar smeddinck avatar tkurz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

redlink-gmbh

more-app-multiplatform's Issues

login token reuse

can't log back in using the same token on the same device. it is possible that a participant changes their device or deletes the app by mistake, they should be able to participate in the study using their old token (Devender)

study activities overview - filtering

shows all activities in study in one long list by default, filters need to work and ideally study managers get to configure filter that is applied by default for a study (Jan)

detail view on modules

the detailed information on a specific module vanishes quickly when clicking on the right arrow (Daniela)

Viewing observations - never ending lists

all upcoming observations are visible at once, which in this case (with only one planned observation) it comes to almost 200 separate items in a never ending list

Suggestion: perhaps don't show the repetition of each observation, but rather each separate observation and maybe a line item for how often it is repeated

(Faith)

intervention notifications

intervention push notifications sometimes appear only as a notification and not in the notification tab (especially if the app is closed or not in the foreground) - Devender

UX/UI: registration token - error message

"System error!" as error message when providing invalid token is not very telling, improve error messaging based on issue that occured to allow users to better specify issues and identify pathways to resolve (Jan)

Notification Issue after change the Study Endpoint!

When attempting to compile and run the "MORE" app on my local machine using Android Studio Giraffe | 2022.3.1 Patch 1, I encountered an issue related to push notifications. The problem arises when I configure the study endpoint to use our instance at "https://data.more-health.at/api/v1."

To test whether the issue is specific to the endpoint, I changed the endpoint configuration to "https://data.platform-test.more.redlink.io/api/v1."

When using the "https://data.platform-test.more.redlink.io/api/v1" endpoint, the push notifications function correctly, and I receive them as expected!

I expected the push notification messages to work correctly when the app is configured with the "https://data.more-health.at/api/v1" endpoint as well.

leaving a study

spelling mistake on the swipe button "Swipe to withdraw" (Faith)

Error in Notification when Observations (limesurvey and simple questioners) are triggered as a result of an Intervention

When an observation is triggered as a result of an intervention, it disappears from the Notification tab upon opening it once, even when it has not being completed.

Also, the notification message containing the observation become sometimes non clickable (randomly) when they appear under notification tab.

Further lime survey set an an action inside an intervention some time does not work. this behavior is random.

Ideally the notification containing the observation should become inactive in the Notification tab only when it has being completed.

UX/UI: Welcome Screen - what is study endpoint?

unclear what "study endpoint is

Suggestion: rename to "study server" and add additional information (e.g. via help icon) that explains that this URL should be provided by the study conductors

(Jan)

notifications while app is closed

new notifications only appear under the notification tab (inside the app) only when the app is open. The push notification that arrived when the app was closed does not appear under the notification tab within the app (Devender)

UX/UI issue on Polar Verity Sense connection page

  • Polar Verity Sense needs location/GPS to be turned on for connection and if the GPS on Phone is not turned on, Polar device will not connect/pair and app does not even ask user to turn on the GPS. This leads to confusion some times.

  • Sometimes the connected device is shown in the app when we pair the device via Bluetooth, but no data is collected. This behaviour is rectified if we close and reopen the app.

  • Once a devices is already connected, no need to continuously scan the BLE as it drains battery and also interface looks confusing/cluttered with the list of device. Scan only when device is not connected.

IMG_20230911_142323

When study is paused both iOS and Android continue showing Home screen!

Occasionally, when a study is paused, the iOS app continues to display the home page (with 3 tabs).
Even when app is cloesd and reopen it still shows the same behaviour.

On Android app after closing and opening it behavous as it should be, but wihout cloesing it, it continues to show the Home page when study is paused. This behaviour is not repitative but happens sometimes.

finishing an observation

the spacing around the popup is really bad, align content consistently and have a border around text and buttons (Faith)

Opening multiple lime surveys issue

When multiple LimeSurveys are active on the dashboard or notification page, users encounter an issue where tapping on the first Lime Survey functions correctly. However, when attempting to tap on the second survey, users are redirected to the previous survey instead of the intended one. This behavior is observed on iPhones.
Please review the attached video for more details on this issue:
https://www.loom.com/share/975b2d37fc7a413ab6b6dd668eccdce5?sid=e4ae6ece-aa62-41f7-812d-c37913198947

Background modules

Modules that run in the background are still shown in the filters on the main screen, remove the observation from the list if it is meant to work in the background (Devender)

Data upload issue when network connection is off for long: Issue on iOS app

If the network is off for the long time (e.g 10-12 hrs) and when too much data get accumulated locally on phone from passive sensing, iOS app starts crashing when the internet is turned on. If the internet is turned off app again starts behaving normally.

Tested on iOS 16.6
Model : iPhone SE

This issue exists only on iOS APP. Android app works as it should.

iOS Content Arrow Issue

In the iOS version, the expanding arrow key on the consent page for each observation does not function as expected, preventing the full text from being displayed.

consent_page

UI/UX: enter registration token - what is it?

unclear what a registration token is and where it is coming from

Suggestion: add additional information (e.g. via help icon) that explains that this URL should be provided by the study conductors

(Jan)

data capture stops at midnight

Data capture for passive sensing sensors (e.g. Acc, GPS) stops at midnight. For the next day observation app needs to be opened again. Next day observation don't start automatically.

(Devender)

making observations

questions from a previous day that should not be available anymore can be answered, should not be so (Sebastian)

Preventing Observation Launch from Notification Page After Observation Time Has Passed or Participants Have Responded.

There is an issue with the notification tab functionality related to running observations.
The problem arises when participants receive notifications for interventions involving observations (e.g., Limesurvey or a simple questionnaire). Participants can initiate the corresponding observation at any time, irrespective of the valid time range specified for the observation.

Additionally, it has been observed that even if an observation's time range has passed or participants have already responded to it via the dashboard page, the observation for the next scheduled time is automatically filled out instead!

To provide a clearer understanding of this issue, I have attached a video demonstrating the bug.
The expected behavior is to restrict observation execution based on the valid time range of an observation and prevent participants from responding if the observation has already been answered.

Please review the attached video for more details on this issue.
https://www.loom.com/share/149d2e2894bb46668157e600424ae70a?sid=6222216d-73fd-4d2a-9a17-b7cd4a48c78e

Observations and study group

In the case where a user is not assigned to any study group (referred to as the entire study), the expectation might be to have access to all observations, regardless of whether thoes observations belong to a study group or not.
However, the current situation only permits the user to view observations that have not been allocated to any study group.

multiple connected devices

app shows multiple connected devices and connected devices disappear on click, no data received or shown in the app. Device connection is not stable and clean (Devender)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.