An advanced, photographic Android port of the SwissMicros C43/C47 project. R47 brings the venerable HP-42S lineage into the modern era, pairing the uncompromising 34-digit decimal precision and arbitrary-precision integer engine of the SwissMicros hardware with a rich suite of Android-native enhancements.
While preserving 100% mathematical parity with the physical SwissMicros hardware and desktop simulators, the Android port introduces dozens of platform-native features designed specifically for touchscreen ergonomics, multitasking, storage workflows, and accessibility.
Choose between authentic hardware aesthetics or clean, modern high-contrast interfaces via Settings β Customization β Calculator Skin:
When using dynamic skins, the keypad adapts in real time to the calculator's internal state:
- Dynamic Shift Rewriting: Engaging
f-shift (gold) org-shift (blue) immediately rewrites the physical on-key labels to show the active secondary functions directly inside each keycap. - Dynamic USER Menu Keys: Custom user key assignments dynamically replace the primary key labels on the fly.
- Context-Sensitive ALPHA Mode: Whenever character input is expectedβeven within programming sub-modes such as defining a label (
LBL) or entering text argumentsβthe keypad automatically transitions into full alphabet entry. - Smart Anti-Clutter Typography: When shift states are engaged, primary labels automatically shrink to prevent crowding, while high-frequency numeric keys (
0β9) and operators (+,-,Γ,Γ·) remain 15% larger for maximum readability. - Collision-Free Label Positioning: Secondary shift labels above keys use fine-tuned horizontal and vertical offsets to ensure zero text overlap even on dense multi-function keys (such as
DRG,xβ·y, andBASE BITS).
- Vintage Green Theme: Faithfully replicates the low-power transflective memory LCD of the physical SwissMicros DM42 hardware.
- High Contrast Theme: Crisp, pure monochrome black-and-white display designed for bright sunlight or high-contrast preference.
- Backlight Luminance Slider: Direct control over screen brightness and contrast (adjustable from 60% to 120%).
- Ergonomic Scaling Modes:
- Adaptive Fit: Intelligently expands to edge-to-edge full width on modern tall smartphone aspect ratios.
- 1:1 Shell (Physical): Locks the on-screen dimensions to the exact physical millimeter measurements of the real calculator based on your device's screen DPI.
- Immersive Fullscreen Mode: Hide Android's status bar and navigation bar for uninterrupted calculation, or keep them visible when using three-button navigation.
Touch and hold anywhere on the calculator's LCD to open the native Display & Clipboard actions dialog:
βββββββββββββββββββββββββββββββββββ
β Display & Clipboard β
βββββββββββββββββββββββββββββββββββ€
β Copy X Register β
β Copy All Registers β
β Paste to X Register β
β Enter PiP Mode β
β Cancel β
βββββββββββββββββββββββββββββββββββ
-
Format-Aware "Copy X Register":
Copies the value of Register X directly to the system clipboard without display formatting spaces:
-
Real Numbers: Clean IEEE decimal representation (e.g.
1234567.89). -
Complex Numbers: Formatted in Cartesian or Polar coordinates (
3. + 4.ior5.β‘53.130102...Β°). -
Angle Multiples of
$\pi$ : Copies cleanly as$\pi$ -multiples (e.g.2.Οror0.25Ο). -
Date and Time: Extracted directly as ISO strings (
2026-10-12or14:30:00). - Strings: Lossless alphanumeric and Unicode string copying without truncation.
- Arbitrary-Precision Long Integers & Short Integers: Full decimal or radix-tagged string.
-
Full Matrices: Instead of a generic
[matrix]placeholder, matrices are formatted with full dimensions and elements:2x2 1.5 0. 0. 2.5
-
Real Numbers: Clean IEEE decimal representation (e.g.
-
"Copy All Registers" (Full Memory Dump):
Exports the entire calculator state in a single tap:
- Stack registers (
T,Z,Y,X,LASTx) - Global registers (
R00throughR99) - Local registers (
R.00...) - Statistical accumulation registers (
SR00throughSR26) Cleanly formatted with<Register> = <Value>lines, ready to paste straight into spreadsheets, Jupyter Notebooks, or engineering notes.
- Stack registers (
-
Universal "Paste to X Register":
Pastes clipboard text directly into Register X with automatic stack lift:
-
Scalars & Scientific Notation: Handles negatives, mantissas, and exponents (e.g.
-1.2345e-12). -
Alphanumeric Strings: Transparently ingests arbitrary strings and text (e.g.
"hello","GrΓΌezi") into Register X as native string data (dtString) without producingNaN. -
Angular Units: Automatically detects
:DEG,:RAD,:GRAD,Β°,deg,rad,grad,'r', and bareΟ/2.Οr. -
Dates & Times: Automatically converts
YYYY-MM-DDorHH:MM:SSinto native Date/Time registers. -
Matrix Ingestion: Detects dimension headers (
X = 2x2or2x2) followed by element rows, automatically reallocates Register X, and populates the matrix elements. -
International Formatting: Normalizes European comma decimals (
1.234,56$\rightarrow$ 1234.56) and US comma groupings (1,234.56$\rightarrow$ 1234.56).
-
Scalars & Scientific Notation: Handles negatives, mantissas, and exponents (e.g.
Multitask effortlessly by running R47 in a compact, interactive floating window over spreadsheets, web browsers, textbooks, and PDF documents:
- Interactive Top Softkeys: The F1 through F6 function keys remain fully operational while in PiP mode.
- Fixed Hardware Aspect Ratio: Locks to the calculator display's native 4860:2667 aspect ratio to eliminate letterboxing.
- Quick Return: Single tap restores the full-screen calculator layout.
Experience authentic acoustic feedback and run sound programs directly on Android:
- Low-Latency PCM Audio: Emulates the hardware piezo beeper using Android's
AudioTrackwithUSAGE_ASSISTANCE_SONIFICATIONand low-latency buffer management. - Acoustic RPN Commands:
BUZZ: Plays precise custom frequencies (Hz) and durations (ms).PLAY: Executes musical score matrices synthesized in RPN program memory (frequency/duration pairs).
- Volume Control Commands: Full execution of
VOLβ,VOLβ,VOL, andVOL?. - In-App Preferences: Beeper enable/disable toggle and dedicated volume slider (0β100%).
- Interruptible Playback: Respects calculator
FLAG_QUIETand cancels playback instantly when a key is pressed.
Simulate the distinct physical click of SwissMicros metal dome key switches:
- Modern Haptic Primitives: Leverages Android API 31+
VibrationEffect.Compositionclick primitives. - Adjustable Intensity: Customize feedback strength from subtle clicks to firm mechanical snaps (0β255 slider).
- Legacy Fallback: Automatic graceful fallback for older Android devices.
Seamlessly connect the calculator to internal storage, SD cards, or cloud folders (Google Drive, Nextcloud):
- Structured Storage Architecture:
STATE/: Full calculator memory snapshots and named sessions.PROGRAMS/: Standalone RPN program files and libraries.SAVFILES/: Hardware-compatible auto-save snapshots (R47auto.sav/C47auto.sav). When configured,R47auto.savauto-loads on boot or reset, exactly like flashing physical DM42 firmware!SCREENS/: Full-resolution timestamped.bmpsnapshots of the LCD screen via theSNAPcommand.DATA/: Register backup and restore files (.d47format viaEXPreg,IMPORTr,EXPstk, etc.).PRINT/: Virtual thermal printer spooling. Infrared/thermal print commands (PRN_XFN,PRINT, etc.) spool directly toPRINT/printer_output.txt.
- Optional TSV Export: Export register tables and statistical data as standard
.TSVfiles directly into theDATA/directory.
BATT/BATT#Battery Telemetry: Queries Android'sBatteryManagerin real time to display live battery percentage and millivolt voltage directly on the LCD screen!DISKStorage Inspection: Queries Android'sStatFson your active partition to report available free storage space and filesystem blocks on the calculator'sTI_DISK_INFOtemporary display screen.SAVEAUT&DELBkup: Direct commands to create or clean up backup states in your Work Directory.
- Auto-Save on Minimize: Automatically serializes calculator RAM when the app moves to the background (
onPause/onStop), guaranteeing zero lost work. - Configurable
f-shiftEXITAction: Choose between minimizing the app to the background (keeping it in Recents) or finishing the activity completely. - Keep Screen On Toggle: Prevents device sleep during long mathematical explorations or bench work.
- Developer Touch Zones: Visual overlay of keyhit bounding boxes and touch coordinates for layout verification.
- Factory Reset: Instant clean slate wipe and restart option in preferences.
Powered by the 34-digit decQuad arithmetic engine, R47 supports rich data types and mathematical subsystems:
To build the desktop simulator or compile the Android APK from source, install the following packages:
sudo apt-get update
sudo apt-get install git build-essential meson ninja-build libgmp-dev libgtk-3-dev libpulse-dev- Java: OpenJDK 17 or higher.
- Android SDK: API 35 (Android 15) or API 36 (Android 16 preview).
- Android NDK: Version
29.0.14206865or newer.
The repository contains the Android shell, JNI bridge, and build automation. Run the sync script to pull the mathematical core from upstream:
git clone https://github.com/paletochen/r47_android.git
cd r47_android
chmod +x sync_public.sh
./sync_public.shEnsure ANDROID_SDK_ROOT is configured in your shell:
./build_android.shThe compiled APK will be generated at:
android/app/build/outputs/apk/debug/R47calculator-debug-local.apk
./dist.shThis builds the GTK3-based desktop simulator and DM42/DM42n firmware binaries.
You can customize SDK, NDK, or CMake versions to match your local installation:
Create or edit android/gradle.properties:
r47.compileSdk=35
r47.targetSdk=35
r47.ndkVersion=29.0.14206865
r47.cmakeVersion=3.28.1Tip: To target Android 16 preview, set r47.compileSdk=36 and r47.targetSdk=36.
export R47_NDK_VERSION="29.0.14206865"
./build_android.shPowerShell:
$env:R47_NDK_VERSION="29.0.14206865"; ./build_android.shCommand Prompt (CMD):
set R47_NDK_VERSION=29.0.14206865 && ./build_android.shThe project includes an automated verification harness with 13 native C invariant tests and Kotlin unit tests:
./test_android.shThe test suite validates:
- Core item availability and softmenu mapping
- SNAP screenshot BMP header correctness
- Copy X ASCII cleanliness and IEEE formatting
- Virtual infrared thermal printer line buffering and frame yielding
- Audio frequency/duration clamping and bidirectional volume conversion
- Matrix LCD canvas layout and row fitting
- Softmenu frame and divider rasterization
- State save/restore integrity
- Battery telemetry and disk space reporting
- Picture-in-Picture window aspect ratios
- SwissMicros C43/C47 Core: Based on the mathematical engine by the WP43/C47 team and SwissMicros.
- Official Owner's Manual: The comprehensive 259-page reference manual (
C47_R47_calc.pdf) is available underdocs/manual/(built withmake -C docs/manual pdformake pdf), detailing RPN stack mechanics, registers, flags, menus, TVM, solvers, and structured programming. - Application Notes: Extensive technical notes and specifications covering all advanced subsystems are available under
docs/appnotes/(including AN0007 for structured programming, AN0012 for TVM, AN0020 for Matrix/Vector, and AN0025 for.d47register file formats). - License: This Android port is licensed under the GNU General Public License v3.0 (GPL-3.0).
- Independent community contribution; not officially affiliated with SwissMicros.














