Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

This is a contact tracing and social distancing app built using SAP BTP SDK for Android version 3.1.2 that takes advantage of SAP Mobile Services.

License

Notifications You must be signed in to change notification settings

SAP-archive/safety-at-work-android

Repository files navigation

Important Notice

This public repository is read-only and no longer maintained. For the latest sample code repositories, visit the SAP Samples organization.

Safety@work for Android

Safety@Work header

REUSE status License

Heavily based on project DP3T

Table of contents

DP3T

The Decentralised Privacy-Preserving Proximity Tracing (DP-3T) project is an open protocol for COVID-19 proximity tracing using Bluetooth Low Energy functionality on mobile devices that ensures personal data and computation stays entirely on an individual's phone. It was produced by a core team of over 25 scientists and academic researchers from across Europe. It has also been scrutinized and improved by the wider community.

DP-3T is a free-standing effort started at EPFL and ETHZ that produced this protocol and that is implementing it in an open-sourced app and server.

Introduction of DP3T

This is the first implementation of the DP-3T "low bandwidth" protocol. The current implementation does not use the "Contact Tracing" API of Apple/Google--and has limitations as a result. Our "hybrid approach" uses Bluetooth Low Energy (BLE) to exchange EphIDs. It uses advertisements whenever possible and falls back to GATT Server connections if not possible to transmit/collect an EphID this way. This approach can result in higher energy consumption and scalability issues and will be replaced by the Apple/Google API.

Safety@work Android App

Safety@work has 3 main functionalities:

  1. garantee contact distance (based on RSSI and tx power level)
  2. contact tracing (DP3T heavily based)
  3. Beacon integration protocol (for real time meeting room and common space monitoring)

The app takes advantage on SAP Business Technology Platform mobile services and is built using SAP Business Technology Platform SDK for Android version 3.1.2,

Onboarding is developed using SAP Business Technology Platform SDK for Android

Proxy Class generation for Odata service are developed by SAP Business Technology Platform SDK for Android

Prerequisites

The Project takes advantage on classes from DP3T open-source project (package org.dpppt.android.sdk), dependencies are managed with gradle

Application leverage on:

  • Notification
  • Bluetooth
  • Location (only for Beacons monitoring, app doesn't trace the GPS user location)
  • SQLite to store EphemeralID received from others devices
  • Service for background task include the name of your service in the Android manifest file.

Project structure

  • [Java package] org.dppt.android.sdk DP3T sources
  • [App] all project activity

If you installed backend on SAP Business Technology Platform services you have to modify some properties in

Appconfig class pointe 
-Application identifier
-destination name

and

-telephone in AndroidManifest.xml

in welcomeActivity class (Appfongi Builder)
-appid (id of your app on BTP)
-host (host of mobile services)

to match your appID or your host.

Permission

Tested on

Android version **Android 7.0,9.0** 
Build with **Android Studio 3.6**

Built with

**Java 1.8**
Gradle version 5.6.4
Android gradle plugin version 3.5.1
Target sdk version 29
Min target sdk version 23

Images from

Undraw (https://undraw.co/illustrations ) under free license (https://undraw.co/license)
Images from Icons-8 (icons8-security_checked and icons8-warning_shield)
DP3T app

All other images are owned by SAP

How Application works

Application works on DP3T core based on anonymous exchange of ID between devices through Bluetooth, When application starts user is informed about scop of application and use of Bluetooth,IBeacon and notification asking for authorization. After onboarding on the main screen user can

turn on/turn off tracing
know if any of your colleagues met in the last few days is infected

In background the app scan for sepcifice bluetooth service and broadcast ephemeralID, when find a device with safety@works installed start to comunicate ephemeralID and ask the other device to send Its own epehermalID.

EphemeralID broadcasted is a token like this 24 b5 a4 17 0b b1 55 3d ba de 10 f3 d1 d5 e5 7e and for security reason change every 15 minutes. the ephemeralID doesn't contain information about device or user.

This application is an enterprise application so work in a centralized mode, when background task is woke up:

1 my ephemeral ID brodacasted in the current day
2 the ephemeral IDs with whom I have been in contact for more than 5 minutes and with a distance (based on RSSI) sufficient for the infection 

If an employee is infected by Covid-19 and sent mail to HR department, the application backend find all the ephemeralID with whom the epmloyee has been in contact and send a push notification on the possibile infected employees device.

If two or more employees doesn't respect safety distance a notification appear on employee device.

Notification

When employees meet each others in a meeting room or a common space where is present a bluetooth beacon, iPhone send to backend anonymously that a new employee enter in a meeting room or in a common space.

In this way on the backend facility administrator knows in real time how many people are inside the meeting room or in a common space.

Screenshot

Onboarding step 1

Onboarding

Onboarding step 2

Onboarding

Onboarding step 3

Onboarding

Onboarding step 4

Onboarding

Main

Main

Main Infected

Infected

Languages supported

Italian
English

BTP Mobile Services app configuration

On mobile services a new Native application must be created and linked to the existing project. Below picture shows the application available within BTP Mobile services.

Mobile services apps page

That application must have following feature assigned:

Native app assigned features

  • Mobile client log upload - in order to submit all logs stored in mobile app;

  • Mobile client usage and feedbacks - necessary to keep track of user activities, within BTP Mobile services, in interacting with the app;

  • Mobile connectivity - this feature is the "core" one: it is mandatory to properly configure destinations that point to back-end business logic (see next section for a deep dive into configuration details);

  • Mobile push notification - in order to push back-end messages, this feature must be in place and properly configured;

  • Mobile Settings exchange - necessary to manage all additional settings of the app (e.g. pincode structure, biometric features, etc...).

About Mobile connectivity feature, two destinations must be configured, as depicted in following picture:

Mobile connectivity details

Paths to destinations must be:

Name URL
safetyatworkdestination https://<cv-19-tracing-xsjs module path>/odata/services.xsodata
xsjsFunctions https://<cv-19-tracing-xsjs module path>/xsjs/functions.xsjs

Where <cv-19-tracing-xsjs module path> is the path to the xsjs module of back-end MTA app:

CF Spaces CV19-tracing back-end modules

Once accessed the application in the CF Space cockpit, the url can be found in the Application routes section:

CV19-tracing back-end xsjs module application

Tutorials for SAP Business Technology Platform mobile services and SDK for Android

Check out these tutorials and courses for deep-dives into various areas

SAP TechEd on mobility

Watch SAP TechEd sessions on mobility online at SAP Teched Online.

License

Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.