Now that our physical application has a fully working circuit to read our heart rate through an unconventional use of a light sensor, we should complete the prototype with an Android application. From the Android Studio, start a new Android project called HeartMonitor with Android API 19. During the bootstrap process, choose a Blank Activity named Monitor.
We start writing the application from the user interface, and we have to think and design the activity layout. For the purpose of this application, we write a simple layout with a title and a text component that we will update every time Android receives a heartbeat estimation from the sketch. This layout could be achieved through the following steps:
In the
styles.xml
file underres/values/
,add these color declarations and replace the standard theme:<color name="sulu">#CBE86B</color> <color name="bright_red">#A30006</color> <style name="AppTheme" parent="Theme.AppCompat"> <...