• Stars
    star
    341
  • Rank 123,427 (Top 3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code components for starting your own Digital Wellbeing experiments

Digital Wellbeing Experiments toolkit

Digital Wellbeing Hero Image

This repository contains example code for some of the Android features used to create Experiments for the Digital Wellbeing collection on the Experiments with Google site. Each directory contains a simple building block that you could use to start creating your own Digital Wellbeing Experiment, or integrate into an existing project.

About Digital Wellbeing

The platform is a collection of ideas and tools that help people find a better balance with technology - exploring themes like how we find focus, avoid distractions and spend more quality time with others. We hope to inspire you to make digital wellbeing a key aspect to everything you design and make. Code from the experiments is open source, and we have created helpful guides to get you started. The more people that get involved the more we can all learn about building better technology for everyone.

Consider copresence

Copresence

We Flip is an experiment that encourages its users to switch off from technology as a group. When a group of users open the app together, they can flip an on-screen switch to put all their devices into Do Not Disturb mode. The first person to unlock breaks the session, ending Do Not Disturb for the group. We Flip uses the Nearby Messages API to detect user copresence.

In the copresence/ folder, there is an example project which demonstrates how devices can simply detect one another using the Nearby API, changing the app's display depending on the number of devices connected.

How could apps use copresence to be more respectful of users spending time together in the real world?

Build for context

Geolocation

Morph is an experiment that helps users stay focussed by adapting their phones to what they're doing, by letting them set up different 'Modes' for the different modes of their life. Each Mode is defined as a collection of apps, and a user defined 'trigger', which can be either a time or a place. This experiment used the Google Maps Places SDK and the Location & GeoFence APIs to switch its functionality based on the user's context, setting triggers for different states based on a user's location.

The example code in the geolocation/ directory shows how the state of an app can be updated by a simple geolocation watcher class. In this example, the location simply triggers a change in the app UI, but could be mapped to any aspect of a full-featured application.

How could changing the functionality of an app based on context help users to focus better on their usage?

Interacting with notifications

Notifications

Post Box is an experiment that helps users minimise distractions by holding notifications until a time that suits them. To build this experiment, we used the Notification Listener API to gather incoming notifications, store them to a database, and present them to the user later at a time that they have configured.

There are three example applications in the notifications/ directory.

The first demonstrates how to create a notification listener service which uses notification access permissions to receive all incoming notifications, add them to a database, and present them in a simple list view to the user.

The second demonstrates how to use the snooze functionality of the Notifications API, which pauses delivery of a notification until a later time. Any notifications received while the app is on screen can be paused for 60 seconds, or allowed to pass through to the OS notification system. This was used in the Morph experiment to pause delivery of notofications from apps outside of a user's current mode.

Finally, a simple notification generator is included for testing your new notification handling experiment.

How could your app use notifications in a way that better respects your user's attention?

Interacting with apps

Apps

Desert Island is an experiment which challenges users to find focus by going a day with only their essential apps. We used the Package Manager API to enumerate the apps installed on the a user's device to present them with a simple, stripped back list of what they have installed on their phones, and keep a track of which apps they open in order to give them feedback on how they use their device.

The example application in appInteraction/ shows how you can easily get a list of a user's installed apps with application name, package name, and icon. It also includes functionality to detect when a new app is installed, and updates itself accordingly. This feature was also used in the Morph and Post Box experiments, to enable and disable launching apps and filtering system notifications, respectively.

How could a launcher or app help users focus, or be less distracted when using their device?

Dynamically surface information

Live Wallpapers

Unlock Clock is an experiment that counts and displays the number of times that you unlock your phone in a day, using an Android Live Wallpaper.

The liveWallpaper/ directory contains the source code for Unlock Clock, which can be modified to display any information to the user.

How else could a live wallpaper help a user to be more conscious of their tech usage?

Schedule future actions

Scheduled Actions

Our phones are always-on, always-connected computers, able to update and notify users of new developments and incoming information in real time. However, live data feeds and streaming messages can be both unpredictable and disruptive to users. Using the Alarm Manager API, your app can defer actions until a scheduled point in the future, rather than interrupting a user with notifications.

In Morph, these timers are used to trigger mode changes in the background, with no need for user input; and in Post Box, they are used to trigger a delivery of notifications at a regular interval.

The scheduledActions directory contains an example project which demonstrates how an app can schedule functionality for future, more appropriate time for the user.

How could you use scheduled actions to build more respectful and purposeful features for your users?


Notes

This sample code was created by Google Creative Lab for a series of Android experiments in the Digital Wellbeing collection. This is not an official Google product.

We encourage open sourcing projects as a way of learning from each other. Please respect our and other creators’ rights, including copyright and trademark rights when present when sharing these works and creating derivative work. If you want more info on Google's policy, you can find it here. To contribute to the project, please refer to the contributing document in this repository.

More Repositories

1

anypixel

A web-friendly way for anyone to build unusual displays
C
6,437
star
2

quickdraw-dataset

Documentation on how to access and use the Quick, Draw! Dataset.
6,092
star
3

teachable-machine-v1

Explore how machine learning works, live in the browser. No coding required.
JavaScript
3,848
star
4

coder

A simple way to make web stuff on Raspberry Pi
JavaScript
2,425
star
5

open-nsynth-super

Open NSynth Super is an experimental physical interface for the NSynth algorithm
C++
2,419
star
6

chrome-music-lab

A collection of experiments for exploring how music works, all built with the Web Audio API.
JavaScript
2,127
star
7

aiexperiments-ai-duet

A piano that responds to you.
JavaScript
1,631
star
8

teachablemachine-community

Example code snippets and machine learning code for Teachable Machine
TypeScript
1,488
star
9

paper-signals

Build your own voice controlled object.
C++
742
star
10

aiexperiments-drum-machine

Thousands of everyday sounds, organized using machine learning.
JavaScript
736
star
11

Sprayscape

Sprayscape is a perfectly imperfect VR-ish camera. It is an open source Android app released on the Android Experiments platform.
Objective-C
568
star
12

teachable-machine-boilerplate

Boilerplate code for Teachable Machine
JavaScript
504
star
13

aiexperiments-giorgio-cam

Take a picture to make music with the computer.
JavaScript
481
star
14

aiexperiments-bird-sounds

Thousands of bird sounds visualized using machine learning.
JavaScript
474
star
15

ar-drawing-java

A simple AR drawing experiment build in Java using ARCore.
Java
415
star
16

inside-music

Inside Music lets you step inside of a song, seeing its individual pieces to give you a closer look at how music is made.
JavaScript
384
star
17

meter

Meter is a data-driven wallpaper that displays your battery, wireless signal and notifications
Java
362
star
18

giantemoji

JavaScript
313
star
19

creatability-components

Web components for making creative tools more accessible.
TypeScript
287
star
20

morse-learn

A fun little web app to help you learn Morse code on Gboard.
JavaScript
284
star
21

alto

Explore the basics of machine learning by building your own teachable object at home.
Python
278
star
22

aiexperiments-sound-maker

Make unusual new sounds with machine learning.
JavaScript
255
star
23

justaline-android

The first cross-platform collaborative AR app (for doodling)
Java
252
star
24

shadercam

Simple OpenGL Shaders with the camera2 apis in Android 5.0+
Java
240
star
25

posenet-sketchbook

PoseNet Sketchbook is a collection of open source, interactive web experiments designed to allude to the artistic possibilities of using PoseNet (running on tensorflow.js) to create a relationship between movement and machine.
JavaScript
207
star
26

arexperiments-portal-painter

Doodle new worlds onto your own, with Google ARCore.
C#
198
star
27

beat-blender

Blend beats using machine learning to create music in a fun new way.
JavaScript
190
star
28

coder-projects

Fun projects and sneakily educational things that can all be made with Coder and Rasberry Pi.
CSS
188
star
29

landmarker

Orientation, GPS, and Places enabled Android Experiment
Java
180
star
30

webvr-musicalforest

Join users from around the world in a musical forest. A WebVR Experiment.
JavaScript
164
star
31

balloon-pop

A multiplayer geospatial experience
C#
163
star
32

melody-mixer

A fun way to explore music using machine learning.
JavaScript
153
star
33

lipswap

Replace sections of a photo with your own recorded video.
Java
142
star
34

norman-ar

Decorate your world with AR animations.
C++
136
star
35

justaline-ios

The first cross-platform collaborative AR app (for doodling)
Swift
120
star
36

quickdraw-component

Use any of the of the 50 million Quick, Draw! doodles in your web-based project with one line of markup
JavaScript
104
star
37

creatability-seeing-music

Experience music visually.
JavaScript
101
star
38

semi-conductor

Semi-Conductor allows you to conduct a virtual orchestra using only your web browser & webcam.
JavaScript
100
star
39

tunnelvision

Distort your surroundings through a collection of transformative filters
Java
93
star
40

lines-of-play

Design domino art creations that interact with the real world using the ARCore Depth API.
C#
89
star
41

project-oasis

A voice controlled terrarium that recreates outside weather inside a box
JavaScript
89
star
42

access-mars

JavaScript
82
star
43

tiny-motion-trainer

Train and test machine learning models for your Arduino Nano 33 BLE Sense in the browser.
JavaScript
79
star
44

mystery-animal

A new spin on the classic 20-questions game.
JavaScript
79
star
45

mix-lab

MixLab is an experiment that makes it easier for anyone to create music, using simple voice commands.
TypeScript
71
star
46

sounds-in-space

An interactive audio experience, where the virtual sounds you hear change depending on your physical location.
C#
70
star
47

tf4micro-motion-kit

Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.
C++
66
star
48

obvi

A Polymer 3+ webcomponent / button for doing speech recognition
JavaScript
57
star
49

finger-user-interface

Control connected devices with the wave of a finger.
C
54
star
50

xyfi

Xyfi: BYO pointing device at a physical installation
JavaScript
48
star
51

morse-speak-demo

Text-to-Speech (TTS) demo web app that converts written text into spoken words via Morse code
JavaScript
44
star
52

aog-canvas-quiz

Canvas Quiz is a starter kit for developers to make custom, voice-enabled question-answer games for the Google Assistant.
JavaScript
40
star
53

air-snare

Play drums in the air.
Svelte
40
star
54

webvr-speaktogo

Explore the world with your voice.
JavaScript
34
star
55

norman-sketch-player

Embed Norman animated sketches on the web
JavaScript
29
star
56

pattern-radio

Code for patternradio.withgoogle.com
JavaScript
27
star
57

things-with-firebase-at-io2017

The Android Things projects used in the Experiments Tent at Google I/O 2017
Java
22
star
58

astrowand

Draw shapes in the sky to form constellations with TensorFlow and a microcontroller.
JavaScript
19
star
59

visual-alarm-clock

Get up in the morning by striking a pose to stop your alarm from ringing.
C++
10
star
60

dat.fire

JavaScript
6
star
61

.allstar

2
star
62

.github

1
star