# Android SMS Gateway — UI/UX Design Handoff ## 1. Purpose This document describes every user-facing surface currently implemented in Android SMS Gateway. It is intended to give the product design team enough functional context to redesign the experience without changing gateway behavior accidentally. The product turns a dedicated Android phone into a directly reachable HTTP SMS gateway. The primary user is a technical operator who installs the app, grants SMS permissions, configures security/networking, starts the server, and monitors its health. The operator may revisit the app only when diagnosing a problem, rotating credentials, or reviewing messages and API traffic. The visual design should communicate three things immediately: 1. Is the gateway operational? 2. Is it secure and reachable? 3. What happened most recently? ## 2. Current Surface Inventory | Surface | Type | Primary purpose | |---|---|---| | Dashboard | Main navigation page | Monitor gateway status and start or stop the server | | Messages — Incoming | Tab within Messages | Review SMS messages received by the phone | | Messages — Outgoing | Tab within Messages | Review SMS messages submitted through the gateway | | Request Logs | Main navigation page | Diagnose HTTP requests and failures | | Server Settings | Main navigation page | Configure port, bind address, reboot behavior, and reach Permissions | | Security Settings | Main navigation page | Configure API authentication and IP allowlisting | | SMS Permissions | Secondary Android page | Review and request required Android permissions | | API Documentation | Browser page at `/docs` | Interactive Swagger UI for backend developers | | Foreground Notification | Android system notification | Keep the server alive and expose its live state/stop action | There is no onboarding wizard, message-detail page, log-detail page, manual SMS composer, API-key reveal page, or dedicated About page in the current MVP. ## 3. Global Application Structure ### 3.1 Page headers - Every primary page uses an in-content branded header with a mint message-gateway mark, page title, and uppercase contextual subtitle. - Dashboard: **SMS Gateway / Operations console** - Messages: **Messages / Live SMS activity**, with a Live badge - Request Logs: **Request logs / HTTP traffic**, with a Live badge - Server: **Server / Network configuration** - Security: **Security / Access control** - Permissions: **SMS permissions / Android access**, with a standard back arrow - Headers remain intentionally free of accounts, avatars, and generic overflow actions because credentials belong to the gateway, not an end-user account. ### 3.2 Primary navigation Five destinations appear in the bottom navigation bar: 1. Dashboard 2. Messages 3. Logs 4. Server 5. Security The implementation uses clear outlined Material-style icons while keeping labels visible: - Dashboard: dashboard, monitoring, or home icon - Messages: chat/message icon - Logs: receipt, list, or terminal-style icon - Server: DNS/server/settings icon - Security: shield/lock icon The Permissions page is secondary. It is entered from Server Settings and temporarily replaces the bottom navigation with a back action. ### 3.3 Theme - Material 3 with a fixed gateway design system matching the approved Figma file - Light and dark themes follow the Android system setting. - The palette is intentionally stable across Android devices instead of using dynamic wallpaper colors. - Core roles include deep ink green, operational primary green, signal mint, network blue, and reserved warning/error colors. - Status colors must remain understandable without relying only on color. Always combine color with text and/or an icon. ### 3.4 Loading state At initial launch, the app preserves its shell and shows the gateway brand mark, an indeterminate progress indicator, and **Preparing gateway** while settings initialize. Stale server state is not shown as current. ### 3.5 Feedback Short confirmations and validation errors appear as bottom snackbars. Existing messages include: - `Port must be between 1024 and 65535` - `Bind address must be a valid IP address` - `Server settings saved` - `API key must contain at least 16 characters` - `API key updated` - `Enter a valid IPv4 or IPv6 address` - `Allowed IP added` Errors should remain visible long enough to read and should identify the field that needs attention. Where possible, the redesign should also show errors inline beneath the affected input. ## 4. Dashboard ### 4.1 Goal Give the operator a reliable at-a-glance answer about server health, reachability, traffic, SMS activity, and security readiness. ### 4.2 Content order #### Server status card Current content: - Status indicator and text - Device IP and configured port, formatted as `192.168.1.50:8080` - Current-process uptime in `HH:MM:SS` - Last server error, only when present - Primary Start or Stop button Server states that must be represented: | State | Meaning | Expected action treatment | |---|---|---| | Stopped | No HTTP listener is running | Primary action: Start server | | Starting | Start is in progress | Disable repeated start; show progress | | Running | Server accepts connections | Primary/destructive action: Stop server | | Stopping | Shutdown is in progress | Disable repeated stop; show progress | | Error | Start/stop failed | Show readable error and offer Start/Retry when appropriate | Implemented visual convention: - Running uses the deep green hero card, a success badge, and a healthy check icon. - Stopped uses a neutral surface and a clear **Start server** action. - Starting and stopping use informational progress semantics and disable repeated actions. - Error uses the reserved error palette and exposes a **Retry** action. - The address has a copy action. - A running gateway exposes **Open API docs**, which opens `http://
:/docs`. #### Metric cards Three equal cards display lifetime local counts: - Requests - Sent - Received Definitions: - Requests: persisted HTTP request log count. - Sent: total outgoing records, including pending, sent, and failed submissions. - Received: total incoming records. The word **Sent** may imply successful delivery even though the value is currently total outgoing submissions. The design should use a less ambiguous label such as **Outgoing** unless product requirements change the metric. #### Last request card When a request exists: - First line: HTTP method and path, for example `POST /api/v1/sms/send` - Second line: status code, duration, and client IP, for example `202 · 42 ms · 192.168.1.10` Empty state copy: **No requests yet** Useful visual semantics: - 2xx: success - 4xx: client/authentication/configuration issue - 5xx: gateway failure - Method may be represented by a compact badge. #### Security setup warning Condition: authentication is enabled but no API key has been configured. Current copy: > Security setup required: configure an API key before connecting a backend. This warning should be prominent and actionable. Recommended action: **Configure security**, deep-linking to Security Settings. ### 4.3 Dashboard states The design must cover: - First launch: stopped, zero metrics, no last request, API-key warning - Running normally - Starting and stopping - Server error with a potentially long error string - IP unavailable - Large counters - Long IPv6 address plus port - Authentication intentionally disabled - Server running while SMS permissions are missing ## 5. Messages ### 5.1 Goal Allow the operator to inspect recent incoming and outgoing SMS activity efficiently, including sender/recipient, body, time, and status. ### 5.2 Shared structure - Two tabs: **Incoming** and **Outgoing** - A single-line Search field below the tabs - Lazy scrolling list below Search - Search text is limited to 100 characters - Search is case-insensitive - Up to the most recent 200 records of each direction are loaded into the current UI The selected tab and search query survive ordinary Compose state recreation. ### 5.3 Incoming tab Search matches: - Sender address/phone number - Message body Each row contains: - Sender, emphasized - Status, currently `received` - Message preview, maximum three lines - Localized date and time ### 5.4 Outgoing tab Search matches: - Recipient address/phone number - Message body - Status Each row contains: - Recipient, emphasized - Status: `pending`, `sent`, or `failed` - Message preview, maximum three lines - Localized date and time Status meanings: - Pending: submitted to Android and awaiting its send result - Sent: Android accepted the SMS operation; not a carrier delivery receipt - Failed: Android reported or threw a sending failure ### 5.5 Required list states The implementation explicitly provides: - No incoming messages yet - No outgoing messages yet - No results for the current search - Loading or refreshing - Very long phone number/address - Very long or multiline body - Failed outgoing message with error indication ### 5.6 Recommended row interaction Rows are currently not clickable. If the design introduces a detail view, it should be specified as a future enhancement rather than assumed to exist. A useful detail page could expose: - Full message body - Full sender/recipient - Direction and status - Created/requested/updated timestamps - Message UUID - Failure code for outgoing messages - Copy actions Do not add reply, resend, delete, or manual-send controls without a product decision; these actions do not currently exist. ## 6. Request Logs ### 6.1 Goal Help the operator diagnose backend connectivity, authentication failures, invalid requests, server errors, and response time. ### 6.2 Current row Each log row contains: - HTTP method and path, emphasized - Status code - Client IP address - Duration in milliseconds - Localized timestamp Example: ```text POST /api/v1/sms/send 202 · 192.168.1.10 · 42 ms 8/25/26, 10:30 AM ``` Logs intentionally never include: - API keys - Authorization headers - Request bodies - SMS bodies - Secrets or credentials The local database retains the newest 10,000 request logs; the current UI loads the newest 500. ### 6.3 Required states - No API requests yet - Continuous high-volume traffic - Long paths - IPv6 client address - Slow request - 401 authentication failure - 403 allowlist rejection - 4xx validation error - 5xx server failure ### 6.4 Implemented log tools and future boundary - Numeric status badges use success, warning, and error semantics. - Filter chips are provided for All, Success, 4xx, and 5xx. - Search matches request path, client IP, and HTTP method. - A row detail sheet remains a future option and must expose only already-stored safe metadata. - Never introduce request-header or body display into logs without a separate security review. ## 7. Server Settings ### 7.1 Goal Configure how the embedded HTTP server listens and whether it returns after reboot. ### 7.2 Networking section #### HTTP port - Numeric input only - Maximum five entered digits - Valid range: 1024–65535 - Default: 8080 Invalid save feedback: > Port must be between 1024 and 65535 The design should use a numeric keyboard and show the allowed range near the field. #### Bind address - Single-line text input - Maximum 45 characters to accommodate IPv6 - Must be a valid IPv4 or IPv6 literal - Default: `0.0.0.0` - Supporting copy: **Use 0.0.0.0 to listen on all IPv4 interfaces** Invalid save feedback: > Bind address must be a valid IP address This is an advanced field. Consider adding an explanation or presets: - All IPv4 interfaces — `0.0.0.0` - Local device only — `127.0.0.1` - Custom address Do not imply that a bind address creates routing, port forwarding, a public IP, or TLS. #### Start server after device reboot - Switch - When enabled, the server is restored after Android boot only if it was enabled before reboot. - Vendor battery-management policies may still interfere. #### Save and apply - Full-width primary action - Saves port, bind address, and reboot preference - If the server is running, it restarts automatically so the new network configuration takes effect - Success snackbar: **Server settings saved** The restart consequence should be communicated. For example: **Saving will briefly restart the running server.** ### 7.3 Android access section - Section heading: **Android access** - Outlined action: **Open permissions screen** - Navigates to the dedicated SMS Permissions page ### 7.4 Security warning Current copy: > Unencrypted HTTP should only be exposed on a trusted private network. Use a VPN or TLS reverse proxy for remote access. This warning must remain visible. It should not look like a recoverable field error; an informational warning treatment is more appropriate than generic destructive red. ## 8. Security Settings ### 8.1 Goal Control gateway-level API authentication and restrict which client IP addresses may reach API operations. ### 8.2 Gateway authentication section #### Require API key - Switch - Enabled by default - Changes take effect for subsequent HTTP requests without restarting the server Turning this switch off exposes operational API routes to any network client that can reach the server, subject only to the optional allowlist. The implementation requires explicit confirmation before disabling authentication. #### API-key status Current states: - **API key: not configured** - **API key: configured (hidden)** The stored value is a one-way SHA-256 hash. The original key cannot be shown or recovered. #### New API key - Single-line password input - Characters are visually masked - Maximum 256 characters - Minimum accepted length: 16 characters - Primary action: **Set API key** - Success snackbar: **API key updated** Important UX behavior: - Never reveal an existing key. - Do not offer a fake “show existing key” action. - Clearly state that changing the key immediately invalidates the backend's old key. - Consider a confirmation step because key rotation can disconnect integrations. ### 8.3 IP allowlist section #### Enable allowlist - Switch - When enabled, only exact configured IP addresses may access operational API routes - Documentation routes remain public - CIDR ranges are not supported in the MVP Enabling an empty allowlist blocks every operational API client. The implementation warns and requires confirmation before allowing that locked state. #### Add address - Single-line IP input - Maximum 45 characters - Accepts valid IPv4 or IPv6 literals - Compact **Add** action beside the field - Duplicate values collapse into one stored entry - Success snackbar: **Allowed IP added** #### Allowed-address list - Sorted addresses - Each row displays the complete IP and a **Remove** text action - Removal currently has no confirmation Recommended design considerations: - Make long IPv6 values wrap or scroll without colliding with Remove. - Confirm removal when the list contains only one address and allowlisting is enabled. - Explain that the API log's client IP is the value operators should usually add. ### 8.4 Security footer Current copy explains: - CIDR and HMAC are future capabilities. - API keys and authentication headers are never written to request logs. This content can become a compact “Security notes” informational card. ## 9. SMS Permissions ### 9.1 Entry and navigation - Entered from Server Settings - Top title becomes **SMS Permissions** - Bottom navigation is hidden - A text action returns to Server Settings: **Back to server settings** The implementation uses a standard back arrow in the page header and retains Android system-back behavior. ### 9.2 Introductory copy > Permissions are requested only when you choose to grant them. SMS permissions are required for gateway operation. Permissions must never be requested automatically without user context. ### 9.3 Permission cards Always shown: - Send SMS - Receive SMS Shown on Android 13 and newer: - Gateway notification Each card contains: - Permission label - Status: **Granted** or **Required** - **Grant** button only when missing Functional meanings: - Send SMS: required for `/api/v1/sms/send` - Receive SMS: required to persist incoming messages - Gateway notification: lets Android display the foreground server notification normally ### 9.4 Android settings action - Full-width outlined button: **Open Android app settings** - Opens the OS-level application details page - Necessary when a permission has been permanently denied or must be changed manually ### 9.5 Required states - All granted - One missing - All missing on first run - Permission denied once - Permission permanently denied / “Don't ask again” - User returns from Android Settings with changed permission state The current UI does not distinguish an ordinary denial from permanent denial. The redesign should reserve space for rationale and a direct Settings action when Android will no longer show the permission prompt. ## 10. API Documentation Web Page ### 10.1 Location ```text http://:/docs ``` ### 10.2 Purpose Provide backend developers with interactive API documentation directly from the gateway, even without internet access. ### 10.3 Current experience - Locally bundled Swagger UI - No external CDN dependency - Loads the packaged OpenAPI document from `/docs/openapi.yaml` - Search/filter field for operations - Expandable endpoint documentation - Schemas, examples, error responses, and status codes - Authorization dialog for Bearer API key or `X-API-Key` - “Try it out” sends requests to the same gateway origin by default - Request duration is displayed The documentation page and raw OpenAPI contract are public. Calling operational API endpoints still requires the configured authentication and allowlist. ### 10.4 Design constraints - This surface is primarily desktop-browser oriented but should remain usable on mobile. - It must work offline from the gateway APK. - Do not add analytics, external fonts, CDN scripts, or external image dependencies. - API keys entered into Swagger UI are not persisted across reloads. - The API documentation should remain visually distinct from the Android operator UI unless a future branded documentation theme is deliberately introduced. ## 11. Foreground Server Notification ### 11.1 Purpose Android requires a foreground notification for the long-running embedded server. This is an operational surface, not a marketing notification. ### 11.2 Current content - Title: **SMS Gateway** - Live content based on server state - Running example: **Listening on 192.168.1.50:8080** - Error state: latest server error - Other states: Starting, Stopping, or Stopped - Tapping the notification opens the app - Action: **Stop** - Notification is ongoing, low importance, and silent The notification must remain compact, clear, and non-alarming. The Stop action is consequential and should be visually distinct, but Android notification actions do not support complex confirmation flows. ## 12. Cross-Screen State and Behavior ### 12.1 Live updates These values update reactively while the app is open: - Server state - Settings - Request count - Incoming/outgoing counts - Last request - Recent incoming and outgoing messages - Recent request logs Designs should not require manual refresh for ordinary updates. ### 12.2 Persistence Persisted across app/process restarts: - Device ID - Port and bind address - Desired server-enabled state - Reboot setting - Authentication and API-key hash - Allowlist state and entries - Incoming/outgoing SMS history - Request logs Not persisted as user data: - Current page selection - Temporary API-key input - Temporary IP-address input - Snackbar messages - Current-process uptime The selected page, message tab, and search query currently survive ordinary UI state recreation but are not durable product settings. ## 13. Accessibility and Responsive Requirements The redesign should meet these minimum expectations: - Minimum 48 dp interactive targets - Visible text labels for navigation and critical actions - WCAG-appropriate contrast in light and dark themes - Status communicated by icon/text as well as color - Support increased Android font sizes without clipped actions or overlapping metric cards - Support long localized strings - Support IPv6 and long device/network values - Screen-reader labels for icons and status indicators - Logical focus and reading order - Password field announced without exposing entered characters - Reduced-motion-friendly progress indicators - Layout usable from compact phones through tablets The current three-metric horizontal row and five-item navigation bar are likely pressure points at large font scales and narrow widths. Designers should provide responsive alternatives. ## 14. Content and Terminology Preferred consistent terms: - **Gateway**: the Android device/app as a service - **Server**: the embedded HTTP listener - **Incoming**: SMS received by the phone - **Outgoing**: SMS submitted for sending - **Sent**: Android accepted the send operation, not carrier delivery - **API key**: gateway credential - **Allowlist**: permitted exact client IP addresses - **Client IP**: source address recorded for an HTTP request Avoid: - Calling the API key a user password - Claiming a sent SMS was delivered - Implying plaintext HTTP is secure on the public internet - Showing secrets, authorization headers, or SMS bodies in request logs ## 15. Recommended Design Deliverables For a complete handoff back to engineering, provide: 1. Navigation map and screen hierarchy 2. Light and dark high-fidelity screens 3. Dashboard variants for all five server states 4. Empty, loading, populated, search-empty, and error states 5. Compact-phone, large-font, and tablet layouts 6. Component definitions for status badges, metric cards, message rows, log rows, setting rows, warnings, and permission cards 7. Confirmation dialogs for disabling authentication, rotating an API key, enabling an empty allowlist, and stopping the server if desired 8. Snackbar and inline-validation specifications 9. Icon set and accessibility labels 10. Motion/transition behavior where it improves state comprehension ## 16. Engineering Boundaries for the Redesign The visual redesign may freely improve hierarchy, navigation presentation, components, typography, spacing, icons, empty states, and feedback. The following behavior should not change without explicit product/engineering agreement: - Starting/stopping the foreground HTTP server - Port range and bind-address validation - Automatic restart after applying network settings while running - API-key minimum length and one-way storage - Exact-IP-only allowlisting - Android permission request context - Message and log privacy rules - Meaning of pending/sent/failed - Public offline API documentation and protected operational endpoints - Trusted-network warning for plaintext HTTP