Android Smart WebView 7.4 🎉 (Major 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.
- New: All build-time and runtime configurations have been unified into a single file:
-
Robust State Management (Memory Leak Fix):
- CRITICAL: Refactored all state management to eliminate the use of
staticActivityorViewcontexts. This resolves a major potential memory leak that could cause crashes on screen rotation or after prolonged use. - New: The
PluginManagernow acts as a lifecycle-aware singleton, safely holding and providing access to theActivityandWebViewcontext.
- CRITICAL: Refactored all state management to eliminate the use of
-
Core Features Reimagined as Plugins:
- New:
Location,Rating, andDialogfunctionalities have been completely re-implemented as standard, modular plugins (LocationPlugin,RatingPlugin,DialogPlugin). - Benefit: This decouples them from the
MainActivityandFunctionsclasses, making the core codebase cleaner and the features consistently managed through the standard plugin pipeline.
- New:
✨ 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.
- New
-
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.headerproperty for a true fullscreen experience. - Splash Screen: The
ui.splash.extendproperty allows the splash screen to persist until the web page is fully rendered, eliminating white flashes or loading screens.
- Drawer Header: The top header/toolbar can be completely hidden via the
🐞 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.LocationConflict: The Location plugin's JavaScript object was renamed towindow.SWVLocationto resolve a critical conflict with the browser's nativewindow.locationobject, 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.
- Fixed
🛠️ Code & Architectural Improvements
- Decoupled & Organized Code:
- Removed all hardcoded feature logic (location, ratings) from
Functions.javaandMainActivity.java, migrating it into the new plugin system. - Refactored redundant XML layouts into reusable
<include>blocks. - Standardized plugin header comments for improved developer experience.
- Removed all hardcoded feature logic (location, ratings) from
- Optimized Launch Sequence: The app now initializes via a custom
Applicationclass (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.