A feature-rich Android WebView browser application that provides a simple yet powerful web browsing experience with advanced JavaScript integration capabilities.
- WebView Browser: Full-featured web browsing with URL input and navigation
- Intent Integration: Launch URLs via Android intents from other applications
- JavaScript Interface: Custom Android-JavaScript bridge for app interactions
- File Browser: Open and load local files through system file picker
- JavaScript Injection: Runtime JavaScript code injection for web page manipulation
- Multi-Activity Architecture: Different WebView configurations for various use cases
- WebView Debugging: Chrome DevTools integration for debugging (API level 19+)
- Cookie Management: Full cookie support for web sessions
- Permissions: Camera, microphone, and audio recording permissions for media-rich web apps
- Custom User Agent: Android app proxy interface accessible from JavaScript
- Responsive Design: Handles orientation changes and screen configurations
- Background Navigation: Browser-style back/forward navigation
app/src/main/java/com/bh/android/browser/
├── MainActivity.java # Main browser activity with full UI
├── WebViewActivity.java # Simple WebView activity for intent handling
├── WebViewHostActivity.java # Full-screen WebView host
├── WebViewFragment.java # Reusable WebView fragment
├── InputTextFragment.java # JavaScript injection input dialog
└── AppJavaScriptProxy.java # JavaScript-Android bridge interface
The primary browser interface featuring:
- URL input field with keyboard shortcuts
- Progress bar for page loading indication
- Menu options for JavaScript injection and file opening
- Full WebView configuration with debugging enabled
- Cookie management and JavaScript interface
Simplified WebView activity designed for:
- Handling
ACTION_VIEWintents from other apps - Display-only web content with basic navigation
- Title and URL display in text views
- Minimal UI for focused content viewing
Full-screen WebView experience with:
- Fragment-based architecture
- Immersive mode with hidden action bar
- Intent parameter processing
- Navigation bar hiding for distraction-free browsing
The app provides a custom JavaScript interface accessible via androidAppProxy:
// Get device serial number
var deviceId = androidAppProxy.getDeviceId();
// Navigate back
androidAppProxy.back();
// Get access key (base64 encoded)
var accessKey = androidAppProxy.getAccessKey();
// Hide action bar (when in WebViewHostActivity)
androidAppProxy.hideActionBar();The app requires the following permissions:
INTERNET- Web browsing functionalityACCESS_NETWORK_STATE- Network connectivity checksMICROPHONE- WebRTC audio featuresRECORD_AUDIO- Audio recording in web appsMODIFY_AUDIO_SETTINGS- Audio configurationCAMERA- WebRTC video featuresWRITE_EXTERNAL_STORAGE- File downloads and storage
- Target SDK: 28 (Android 9.0)
- Minimum SDK: 14 (Android 4.0)
- Build Tools: 28.0.3
- Support Library: 28.0.0
// Enable JavaScript and debugging
mWebView.getSettings().setJavaScriptEnabled(true);
WebView.setWebContentsDebuggingEnabled(true);
// Media playback without user gesture
mWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
// JavaScript interface
mWebView.addJavascriptInterface(new AppJavaScriptProxy(this, mWebView), "androidAppProxy");The app responds to ACTION_VIEW intents, allowing other apps to open URLs:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>Users can inject custom JavaScript code at runtime through the injection fragment, enabling:
- DOM manipulation
- Custom functionality addition
- Debugging and testing
- Web page enhancement
- Clone the repository
- Open in Android Studio
- Build and run on device or emulator
- Launch the app
- Enter URL in the address bar
- Press Enter or Go to navigate
Other apps can open URLs in this browser by sending ACTION_VIEW intents.
- Click the injection icon in the toolbar
- Enter JavaScript code in the dialog
- Click "Inject" to execute the code on the current page
- Click the file icon in the toolbar
- Select a file from the system file picker
- The file will be loaded in the WebView
- The app uses Android Support Library for backward compatibility
- WebView debugging is enabled for development builds
- All activities handle orientation changes gracefully
- The app supports both HTTP and HTTPS with cleartext traffic allowed
- Custom error handling and progress indication throughout the app