Advanced Features Guide
Explore the architecture, parsing mechanisms, and audio management engines running under the hood of the UPI Payment Alert Gold Edition.
1. Dual SMS & Notification Listeners
The app employs two distinct listeners running concurrently within a sticky foreground lifecycle:
- Notification Listener Service: Binds to the Android Notification Manager. When a notification containing transactional text is posted, the listener intercepts it and extracts the string.
- Broadcast Receiver SMS Listener: Listens for incoming transactional SMS intents. It parses the body text of messages from banking transaction senders.
2. Independent Volume Override
To guarantee alerts are heard even when the device's music volume is set to zero or muted, the app overrides system controls dynamically:
- Before an announcement begins, the app captures the current volume level of the
STREAM_MUSICchannel. - It temporarily sets the stream volume to the percentage value set by the user's slider.
- The TTS engine announces the payment details.
- As soon as the TTS engine signals completion (or encounters an error), the stream volume is restored to its original value.
3. Segmented Speech Rate Control
Instead of slowing down the entire phrase, the app targets the currency amount specifically:
The phrase is structured using piped delimiters (e.g., "Received |500| rupees"). The app loops through the segments, queueing them sequentially:
- Even Segments: Read at the standard baseline speed of
0.9x. - Odd Segments (Amount): Read at the custom speed specified by your Announcement Speed slider.
This allows you to hear the structural announcement at a natural pace while pronouncing the numbers slowly and clearly.
4. Sliding Window Deduplication
Multi-channel alerts (e.g., a notification and an SMS for the same transaction) can cause duplicate announcements. The app maintains a ConcurrentHashMap of recent announcements. If the same phrase is processed within 60 seconds, it is discarded.