Skip to content

Android Smart WebView 7.4 🎉 (Major Release)

Choose a tag to compare

@mgks mgks released this 15 Jul 12:23
· 57 commits to master since this release

This release marks a major architectural leap forward, focusing on making Smart WebView dramatically easier to configure, more modular, and exceptionally stable. The introduction of a central configuration file simplifies setup to a single file, while a complete overhaul of internal logic and state management resolves numerous potential memory leaks and race conditions.

🚀 Architectural Overhaul

  • True Centralized Configuration (swv.properties):

    • New: All build-time and runtime configurations have been unified into a single file: app/src/main/assets/swv.properties. Users can now control App ID, versioning, SDK targets, URLs, and all feature toggles from one place, without ever touching a Gradle or Java file.
    • Benefit: This dramatically simplifies setup for new users, making the project accessible even to those unfamiliar with native Android development.
  • Robust State Management (Memory Leak Fix):

    • CRITICAL: Refactored all state management to eliminate the use of static Activity or View contexts. This resolves a major potential memory leak that could cause crashes on screen rotation or after prolonged use.
    • New: The PluginManager now acts as a lifecycle-aware singleton, safely holding and providing access to the Activity and WebView context.
  • Core Features Reimagined as Plugins:

    • New: Location, Rating, and Dialog functionalities have been completely re-implemented as standard, modular plugins (LocationPlugin, RatingPlugin, DialogPlugin).
    • Benefit: This decouples them from the MainActivity and Functions classes, making the core codebase cleaner and the features consistently managed through the standard plugin pipeline.

New Features & Enhancements

  • Modern JavaScript Interfaces:

    • New LocationPlugin: Replaces the old cookie-based location sharing with a modern, callback-based JavaScript interface (window.SWVLocation.getCurrentPosition(...)) for more reliable, on-demand location fetching.
    • New DialogPlugin: Introduces a generic, highly configurable interface (window.Dialog.show(...)) for triggering native alert dialogs directly from your web content.
  • Dynamic Theming Engine:

    • The app now automatically detects the system's Light/Dark mode on launch.
    • A theme switch in the navigation drawer allows manual toggling.
    • A robust, two-way communication bridge ensures the native UI and web content themes stay perfectly in sync.
  • Configurable UI Elements:

    • Drawer Header: The top header/toolbar can be completely hidden via the ui.drawer.header property for a true fullscreen experience.
    • Splash Screen: The ui.splash.extend property allows the splash screen to persist until the web page is fully rendered, eliminating white flashes or loading screens.

🐞 Bug Fixes & Stability Improvements

  • CRITICAL: Fixed App-Breaking Crashes:

    • Resolved AdMob Startup Crash: Implemented the standard, most reliable method for providing the AdMob Application ID via a dedicated resource file, fixing a common startup crash.
    • Resolved Unhandled URL Scheme Crash: The app no longer crashes when encountering an unknown or legacy custom URL scheme (like getloc:), instead logging the error gracefully.
  • UI Fixes:

    • Status Bar Control: Fixed a critical bug where the WebView would draw under the system status bar. The status bar now correctly displays a solid color with appropriate light/dark icons, respecting the app's theme.
    • Drawer and Refresh Layout: Fixed a bug where the pull-to-refresh gesture conflicted with opening the navigation drawer.
  • Plugin & JS Interface Reliability:

    • Fixed window.Location Conflict: The Location plugin's JavaScript object was renamed to window.SWVLocation to resolve a critical conflict with the browser's native window.location object, making the feature functional on all websites.
    • Playground UI Fixed: Resolved a JavaScript syntax error and a race condition that prevented the Playground UI from appearing or caused it to disappear on page reloads.

🛠️ Code & Architectural Improvements

  • Decoupled & Organized Code:
    • Removed all hardcoded feature logic (location, ratings) from Functions.java and MainActivity.java, migrating it into the new plugin system.
    • Refactored redundant XML layouts into reusable <include> blocks.
    • Standardized plugin header comments for improved developer experience.
  • Optimized Launch Sequence: The app now initializes via a custom Application class (SWVContext$App), ensuring all configurations are loaded at the earliest possible moment to prevent race conditions.

💖 Get Premium Plugins Access

Includes AdMob (Banner, Rewarded, Interstitial), Biometric Auth, QR Scanner, and more — available to monthly sponsors.