Android Smart WebView is a modern, open-source solution for building advanced hybrid Android apps. It provides a robust foundation for converting any website into a feature-rich mobile application, complete with a powerful plugin system for extending native functionality.
DOCUMENTATION | DISCUSSIONS | ISSUES
- Plugin Architecture: Extend app functionality with self-registering, modular plugins.
- File Uploads & Camera Access: Full support for
<input type="file">, including direct camera capture. - Push Notifications: Integrated with Firebase Cloud Messaging (requires
google-services.json). - Google Analytics: Built-in support for usage tracking (configure GTAG ID in
swv.properties). - Custom UI Modes: Choose between a fullscreen immersive layout or a standard drawer navigation layout.
- Location Services: Access device GPS for location-aware web applications.
- Content Sharing: Natively receive and handle content shared from other apps.
- Downloads & Printing: Handle file downloads and print web content using native services.
- Modern & Secure: Built with up-to-date libraries, security best practices, and highly configurable via
swv.properties.
Smart WebView now includes all plugins for free, providing a comprehensive toolkit to build powerful hybrid apps out of the box.
- ✅ AdMob: Integrate Google AdMob banner, interstitial, and rewarded ads.
- ✅ Biometric Authentication: Secure your app with fingerprint or face unlock.
- ✅ QR & Barcode Reader: Natively scan QR codes and barcodes using the device camera.
- ✅ Image Compression: Automatically compress images before uploading to save bandwidth and improve performance.
- ✅ JS Interface: A powerful two-way bridge for seamless communication between your web app's JavaScript and native Android code.
- ✅ Location: On-demand access to the device's GPS location.
- ✅ Native Dialogs: Display native alert and confirmation dialogs from your JavaScript.
- ✅ Toast Messages: Show short, non-blocking native toast notifications.
- ✅ In-App Review: Prompt users to rate your app on the Google Play Store based on usage triggers.
- Clone the repository:
git clone https://github.com/mgks/Android-SmartWebView.git
- Open in Android Studio:
File > Open > Select the cloned project folder
- Configure
swv.properties:- Open
app/src/main/assets/swv.properties. - Change
app.urlto your website's URL and adjust other settings as needed. This is the main configuration file for the app.
- Open
- Add
google-services.json(Optional):- If you plan to use Firebase services (like FCM for push notifications), place your
google-services.jsonfile from the Firebase console into theapp/directory.
- If you plan to use Firebase services (like FCM for push notifications), place your
- Build & Run:
Build > Clean ProjectthenBuild > Rebuild Project.
All primary configuration is done within app/src/main/assets/swv.properties:
- Main Application URL:
- Set
app.urlto your web application's address. offline.url(file:///android_asset/web/offline.html) is used if no internet is detected.
- Set
- Feature Toggles:
- Enable or disable core features (file uploads, camera access, location services, pull-to-refresh, etc.) by modifying the
feature.*boolean properties.
- Enable or disable core features (file uploads, camera access, location services, pull-to-refresh, etc.) by modifying the
- Permissions:
- Review and adjust permissions in
AndroidManifest.xmlbased on the features you enable. For example,CAMERAfor camera uploads,ACCESS_FINE_LOCATIONfor GPS.
- Review and adjust permissions in
- Plugin Configuration:
- Plugin-specific behavior (like AdMob IDs or Biometric Auth on launch) is configured in
Playground.java. This allows you to change settings without modifying the plugin source code itself.
- Plugin-specific behavior (like AdMob IDs or Biometric Auth on launch) is configured in
The best way to understand the project in depth is to explore the source code:
app/src/main/assets/swv.properties: Contains all global configurations.SWVContext.java: The central class that loads the configuration and holds app state.MainActivity.java: The main entry point that handles WebView setup and integrates core features.PluginInterface.java&PluginManager.java: Key components of the plugin architecture.Playground.java: The central place for configuring and testing plugins.- The
plugins/directory: Contains the full source code for all included plugins.
- Found a bug or have an idea? Open an issue or create a pull request.
- Have questions or want to share what you've built? Join the discussion.
This project is licensed under the MIT License.