<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anigilaje Yusuf</title>
    <description>The latest articles on DEV Community by Anigilaje Yusuf (@anigilaje_yusuf).</description>
    <link>https://dev.to/anigilaje_yusuf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4034948%2F3c934496-2437-42a8-883d-70deb00e46d3.png</url>
      <title>DEV Community: Anigilaje Yusuf</title>
      <link>https://dev.to/anigilaje_yusuf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anigilaje_yusuf"/>
    <language>en</language>
    <item>
      <title>PauseBeforePay: a pause between tapping send and the money leaving</title>
      <dc:creator>Anigilaje Yusuf</dc:creator>
      <pubDate>Sun, 22 Nov 2026 23:37:50 +0000</pubDate>
      <link>https://dev.to/anigilaje_yusuf/pausebeforepay-a-pause-between-tapping-send-and-the-money-leaving-kh6</link>
      <guid>https://dev.to/anigilaje_yusuf/pausebeforepay-a-pause-between-tapping-send-and-the-money-leaving-kh6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PauseBeforePay&lt;/strong&gt; is a mock money-transfer app with one extra step.&lt;/p&gt;

&lt;p&gt;Before you confirm a transfer, the front camera reads your pulse rate, your breathing rate, and whether your face looks tense. If you look rushed &lt;em&gt;compared with your own resting rates&lt;/em&gt;, the app does not block anything. It offers you a pause:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;You seem rushed and tense&lt;/strong&gt;&lt;br&gt;
Confirm you actually want to pay.&lt;br&gt;
&lt;code&gt;Pulse 92 bpm · +19&lt;/code&gt;  &lt;code&gt;Face tense&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check this before you send&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;NGN 25,000&lt;/strong&gt; to &lt;strong&gt;Ada Obi&lt;/strong&gt;&lt;br&gt;
Is the amount right? Is this the right person? Is anyone telling you to send this?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then it shows you the amount and the recipient again, offers a three-breath pacer if you want it, and puts &lt;strong&gt;Send anyway&lt;/strong&gt; right there on the screen — always visible, never disabled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is not a bank app, and it is not trying to be one.&lt;/strong&gt; It is a component designed to drop into one — the send form and confirm screen here exist only to give the pause somewhere to live. No bank is connected and no money moves.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why that moment
&lt;/h3&gt;

&lt;p&gt;In 2025 Nigerians lost &lt;strong&gt;₦25.85 billion&lt;/strong&gt; to electronic payment fraud across &lt;strong&gt;67,518 reported cases&lt;/strong&gt; (&lt;a href="https://techeconomy.ng/nibss-digital-payment-fraud-drops-51-to-%E2%82%A625-85b-in-2025" rel="noopener noreferrer"&gt;NIBSS, via the Nigeria Electronic Fraud Forum&lt;/a&gt;). NIBSS named the single biggest technique, and it was not hacking — it was &lt;strong&gt;social engineering&lt;/strong&gt;. Somebody talks you into sending the money yourself.&lt;/p&gt;

&lt;p&gt;The other failure costs just as much and gets less attention: the wrong account number. In Nigeria a completed transfer is &lt;strong&gt;not automatically reversible&lt;/strong&gt;. The CBN's process starts with notifying your own bank, and if the recipient has spent it and will not give it back, recovery can take a court order.&lt;/p&gt;

&lt;p&gt;Both failures happen in the same half second — the moment you tap confirm without really reading the screen, because you are rushed, or because somebody is standing over you. And the confirm screen looks identical in every one of those cases, because it has no idea what state you are in.&lt;/p&gt;

&lt;p&gt;A camera-based vitals SDK gives the app one weak signal about that state. That is a terrible basis for blocking a payment, and a reasonable basis for asking a question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/9dLP9h82PW8" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The video walks through the real app on a physical Android phone: the send form, the consent screen, the live camera check with the SDK's own validation feedback, how a pulse is actually read from light, the decision rule, and the pause screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Yusasif-A/pause-before-pay" rel="noopener noreferrer"&gt;https://github.com/Yusasif-A/pause-before-pay&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Setup is in the README: requirements, where to get a free Presage API key, where to put it (&lt;code&gt;local.properties&lt;/code&gt;, surfaced through &lt;code&gt;BuildConfig&lt;/code&gt; — never committed), and how to build and install. There is also &lt;code&gt;docs/SDK_NOTES.md&lt;/code&gt;, which records everything I verified about the SDK the hard way, including the places the published docs and the shipped AAR disagree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Yusasif-A/pause-before-pay.git
&lt;span class="nb"&gt;cd&lt;/span&gt; pause-before-pay
&lt;span class="c"&gt;# add PRESAGE_API_KEY=... to local.properties&lt;/span&gt;
./gradlew :app:installDebug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Needs a real phone — Android 9+, a real face, and real light.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Signals used: pulse rate, breathing rate, and facial expressions.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask for exactly what you read
&lt;/h3&gt;

&lt;p&gt;The one configuration trap worth warning anyone about: the Android SDK's default metric request is &lt;strong&gt;breathing only&lt;/strong&gt;. Leave out cardio and &lt;code&gt;cardio.pulseRateList&lt;/code&gt; stays empty forever, with no error to tell you why.&lt;/p&gt;

&lt;p&gt;The obvious fix is to request the convenience bundles. I did that first, and then decompiled the shipped AAR to see what they actually expand to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;breathingMetrics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;CHEST_BREATHING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;ABDOMEN_BREATHING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;BREATHING_RATE&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;cardioMetrics&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;PULSE_RATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;ARTERIAL_PRESSURE_TRACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;HRV&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;faceMetrics&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;FACE_LANDMARKS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;BLINKING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TALKING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;EXPRESSIONS&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is &lt;strong&gt;seven metrics&lt;/strong&gt; for an app that reads three. Four of them this app never touches, and each is a separate thing an API key may or may not be entitled to — the SDK has a dedicated &lt;code&gt;METRIC_NOT_AUTHORIZED&lt;/code&gt; error code, so entitlements are real and per-metric. So the app asks for precisely what it uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;requestedMetrics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buildList&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PULSE_RATE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;BREATHING_RATE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;requestExpressions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;EXPRESSIONS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Smaller request, fewer ways to fail, and the consent screen's claim about what is sensed stays literally true.&lt;/p&gt;

&lt;h3&gt;
  
  
  Observe before you start
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="c1"&gt;// metricsFlow is a SharedFlow with no replay. A collector registered after&lt;/span&gt;
&lt;span class="c1"&gt;// start() silently misses whatever was emitted in between.&lt;/span&gt;
&lt;span class="n"&gt;observers&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metricsFlow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;observers&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;validationStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asFlow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;observers&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;processingStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asFlow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;observers&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asFlow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// only now&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Let the SDK tell you which samples are good
&lt;/h3&gt;

&lt;p&gt;My first instinct was to invent a quality metric — average the confidences, pick a cutoff, call it good. Unnecessary. Every sample carries a &lt;code&gt;stable&lt;/code&gt; flag, and the docs say exactly what it means: confidence at or above the published accuracy standard, which is ±3 bpm for pulse and ±1 breath/min for breathing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onPulseSample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timestampMicros&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Long&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;elapsedSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timestampMicros&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;lastPulseTimestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;   &lt;span class="c1"&gt;// the stream can repeat samples&lt;/span&gt;
    &lt;span class="n"&gt;lastPulseTimestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;timestampMicros&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;PLAUSIBLE_PULSE_BPM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="n"&gt;lastPulseSeen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;                               &lt;span class="c1"&gt;// shown live even if unusable&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;elapsedSeconds&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;warmupSeconds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;stable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentValidation&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;PULSE_BLOCKERS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="n"&gt;pulse&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the ordering: a sample can be shown on screen and still not count toward the decision. "Visible" and "trustworthy enough to gate a payment" are different bars.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validation codes are UI copy, not log noise
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;sdk.validationStatus&lt;/code&gt; emits a &lt;code&gt;ValidationCode&lt;/code&gt; plus a human-readable &lt;code&gt;hint&lt;/code&gt;. That stream &lt;em&gt;is&lt;/em&gt; the app's coaching: it drives the chip and the sentence under the preview in real time, and when a scan fails, the most frequent code becomes the retry advice.&lt;/p&gt;

&lt;p&gt;It also taught me not to over-gate. Requiring a bare &lt;code&gt;OK&lt;/code&gt; throughout starves real scans, because real scans drift in and out of perfect framing constantly. So the blocker list is &lt;strong&gt;per metric&lt;/strong&gt;: &lt;code&gt;CHEST_NOT_VISIBLE&lt;/code&gt; ruins a breathing reading and tells you nothing about a pulse reading, so it blocks one and not the other.&lt;/p&gt;

&lt;h3&gt;
  
  
  Timing is published — use it
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;First value&lt;/th&gt;
&lt;th&gt;Confident&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pulse&lt;/td&gt;
&lt;td&gt;~12 s&lt;/td&gt;
&lt;td&gt;~12 s (it &lt;em&gt;is&lt;/em&gt; a 12-second average)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Breathing&lt;/td&gt;
&lt;td&gt;~10 s&lt;/td&gt;
&lt;td&gt;~30 s (confidence is 0 before)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This reshaped the app. My original plan was a 20-second scan discarding the first 8 seconds — but nothing exists before 12 seconds, so that plan had a 12-second warm-up whether I liked it or not. It also means breathing barely participates at payment time, and rather than hide that, the app degrades honestly and the README says so.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get off the main thread
&lt;/h3&gt;

&lt;p&gt;The bug that cost me the most, and the most useful thing I learned. Everything ran on the main thread at first. On a Redmi Note 11 the device log said:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Slow Binder: BpBinder transact took 793ms  ICameraDeviceUser
PerfMonitor doFrame : time=1858ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parsing eight expression scores at 30 Hz and recomposing the screen just as often was sitting &lt;em&gt;in front of&lt;/em&gt; the camera's own binder calls. The SDK saw holes in the frame timestamps and reported &lt;code&gt;TIMESTAMP_GAP&lt;/code&gt; — which it must, because a pulse cannot be read from an unevenly sampled signal.&lt;/p&gt;

&lt;p&gt;It also explained a symptom that had confused me for two days: &lt;strong&gt;expressions kept working while pulse never did.&lt;/strong&gt; Expressions are computed per frame and survive a dropped frame. Pulse needs a continuous window, so a single gap ruins it and it starts over.&lt;/p&gt;

&lt;p&gt;Collectors and the progress tick now run on one background thread. &lt;code&gt;start()&lt;/code&gt; and &lt;code&gt;stop()&lt;/code&gt; stay on main, where CameraX binds its use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  The decision is arithmetic, and it is tested
&lt;/h3&gt;

&lt;p&gt;The app has an optional language-model feature. It is not allowed anywhere near the verdict.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ELEVATED if (scanPulse - restingPulse)       &amp;gt;= 12 bpm
      or (scanBreathing - restingBreathing)  &amp;gt;= 5 breaths/min
      or (tense face reads / all face reads) &amp;gt;= 0.55
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three independent triggers, any one of which offers the pause. A one-time 60-second calibration stores your own resting rates as a &lt;strong&gt;median&lt;/strong&gt; (not a mean — one garbage sample should not move a stored baseline), so the app compares you against yourself rather than a textbook number. With no baseline it falls back to absolute thresholds and says on screen that it is doing so.&lt;/p&gt;

&lt;p&gt;The face earns its place by catching what the pulse rules miss: someone frightened whose heart rate has not moved yet. It is also the noisiest signal, which is why its threshold sits above half, needs at least ten confident samples, and records a face with too few samples as &lt;strong&gt;unjudged&lt;/strong&gt; rather than &lt;strong&gt;settled&lt;/strong&gt; — "we did not look" and "we looked and you were fine" are different facts.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DecisionEngine.decide()&lt;/code&gt; is a pure function over two data classes with every threshold a named constant in one file. &lt;strong&gt;41 JVM unit tests&lt;/strong&gt;, including boundary cases (79.9 bpm over a 68 bpm baseline is calm; 80.0 is elevated) and one test asserting no generated sentence ever contains "diagnos", "scam", "fraud", "coerc" or "stress".&lt;/p&gt;

&lt;h3&gt;
  
  
  It never blocks
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;LOW_CONFIDENCE&lt;/code&gt; is treated as not-elevated. Declining the camera leads to a confirm screen that works. A failed scan offers "Continue without the check". The only state where Confirm is held is a clear &lt;code&gt;ELEVATED&lt;/code&gt; reading, and that screen has &lt;code&gt;Send anyway&lt;/code&gt; on it.&lt;/p&gt;

&lt;p&gt;An app that can hard-stop your money on a heart-rate reading is a worse app than one that cannot.&lt;/p&gt;

&lt;h3&gt;
  
  
  One honest note
&lt;/h3&gt;

&lt;p&gt;On my test phone, in evening light, the camera could not sustain the frame rate the SDK needs, so the measurement in the recording does not complete. The app reports that plainly — &lt;em&gt;"Reading was unclear. Nothing is being held up."&lt;/em&gt; — and lets the transfer through with Confirm enabled.&lt;/p&gt;

&lt;p&gt;Two things I only understood at the end explain it. The test device is a &lt;strong&gt;Redmi Note 11 (Helio G88)&lt;/strong&gt;, which is not on Presage's &lt;a href="https://github.com/Presage-Security/SmartSpectra/blob/main/android/README.md" rel="noopener noreferrer"&gt;supported platforms list&lt;/a&gt; — their tested devices are Pixel, Galaxy and Motorola Edge. And their model card names &lt;em&gt;"flickering illumination"&lt;/em&gt; as a pulse failure case, which is exactly what an LED bulb on 50 Hz mains is. The device log showed the rest: a 793 ms blocking call to &lt;code&gt;ICameraDeviceUser&lt;/code&gt; and a 1858 ms UI frame, and &lt;code&gt;TIMESTAMP_GAP&lt;/code&gt; fires on a gap over two seconds. The camera was stalling outright, and the SDK correctly refused to guess a pulse from an unevenly sampled signal.&lt;/p&gt;

&lt;p&gt;I would rather show that than fake a number. The degradation path is the part of this build I am most glad works, because it is the behaviour that matters most when this idea meets a real phone in bad light.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Thoughtful Real-World Use.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;₦25.85 billion, 67,518 cases, and social engineering as the number one technique. Authorised push payment fraud works by manufacturing urgency — "send it now, the account will close", "your money is at risk, move it immediately". Every bank's answer so far is a static warning screen that everyone taps past, because it appears identically whether you are relaxed or being rushed by someone on the phone.&lt;/p&gt;

&lt;p&gt;This is for people at the moment of a transfer they may regret: the ones sending to a wrong account number because they did not re-read it, the ones pushed into a payment by someone standing over them, the older relative on a call with a "bank official".&lt;/p&gt;

&lt;p&gt;It is deliberately built as a &lt;strong&gt;component, not a product&lt;/strong&gt;. A bank already owns the send form, the confirm screen and the ledger. What it does not have is any read on the person's state at the moment of confirmation, and that is the only thing this adds.&lt;/p&gt;

&lt;p&gt;Designing it to be usable for those people meant three deliberate constraints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It must never block.&lt;/strong&gt; The person who most needs the pause is also the person who most needs to be able to ignore it. &lt;code&gt;Send anyway&lt;/code&gt; is above the fold and always enabled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It must explain, not report.&lt;/strong&gt; The pause leads with &lt;em&gt;"You seem rushed and tense"&lt;/em&gt;, not &lt;em&gt;"92 bpm"&lt;/em&gt;. Numbers stay as evidence underneath.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It must not lie about what it knows.&lt;/strong&gt; No diagnosis, no "scam detected", no claim to identify anyone. The app reads how a face looks, never whose face it is.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a bank, this is a few hundred milliseconds between tapping send and the money leaving. It needs no new hardware — every phone already has a front camera — and it fits beside existing confirmation screens rather than replacing them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Consent is asked before the camera ever starts&lt;/strong&gt;, for both the calibration scan and the payment-time check, on a screen that states in plain words:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What is measured&lt;/strong&gt; — pulse rate, breathing rate, and whether the face looks tense or settled. The screen says explicitly that the app reads &lt;em&gt;how a face looks, never whose face it is&lt;/em&gt;: there is &lt;strong&gt;no face recognition&lt;/strong&gt;, and it cannot identify anyone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why&lt;/strong&gt; — only to decide whether to offer a pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where&lt;/strong&gt; — on the device, inside the SDK. Presage's docs are explicit that metric computation is on-device and the backend is contacted only to authenticate the API key and validate the subscription. Internet is needed for that one check, and the screen says so rather than implying the phone is offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android camera permission&lt;/strong&gt; is requested through the normal system dialog; declining leads to a confirm screen that works normally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SDK telemetry:&lt;/strong&gt; &lt;code&gt;enableTelemetry&lt;/code&gt; defaults to &lt;strong&gt;true&lt;/strong&gt;. The app sets it to &lt;code&gt;false&lt;/code&gt; and says on the consent screen that it has.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retention:&lt;/strong&gt; a payment-time reading is used for the decision on the next screen and then discarded. The only thing that persists is the baseline summary — two medians, two spread values, two sample counts and a date — stored in &lt;code&gt;EncryptedSharedPreferences&lt;/code&gt;. &lt;strong&gt;Delete my baseline&lt;/strong&gt; exists and actually wipes it. No video, no frames, no images are ever recorded, shown later, or uploaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optional AI service:&lt;/strong&gt; there is one opt-in, off-by-default feature that rewords the pause sentence using an external Gemma endpoint. When on, it sends &lt;strong&gt;only the two rounded numbers&lt;/strong&gt; — no amount, no recipient, no identifier, no image. It has a 4-second timeout, is filtered for clinical and fraud vocabulary, and falls back silently to the sentence the decision engine already wrote. It never changes the verdict: the calm-or-elevated call is fixed arithmetic on the phone, with or without the switch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it will not claim:&lt;/strong&gt; no diagnosis, no "scam detected", no "this person is being coerced", no automatic redirection of money. SmartSpectra SDK metrics are for general wellness and informational purposes only and are &lt;strong&gt;not FDA-cleared&lt;/strong&gt;. &lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>presagechallenge</category>
    </item>
  </channel>
</rss>
