The PDF Insight Pro Android app is a lightweight native Java client that wraps the deployed web application in a full-screenDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jatin-Mehra119/PDF-Insight-Beta/llms.txt
Use this file to discover all available pages before exploring further.
WebView. Rather than duplicating API logic on mobile, the app simply loads the live URL of your Hugging Face Spaces deployment (or any publicly accessible instance) and presents it with a native splash screen, hardware back-button navigation, file-upload support, and a download manager — giving mobile users the complete feature set without a separate codebase to maintain.
Architecture
The app is composed of twoActivity classes that chain together in sequence.
SplashActivity
The launcher activity. It displays the app branding in full-screen portrait
mode, sleeps for 3 000 ms on a background thread, fires an
Intent to
start MainActivity, then calls finish() so the splash screen is removed
from the back stack.MainActivity
Hosts the
WebView. On creation it checks network availability via the
CheckNetwork helper class; if no connection is found it shows an
AlertDialog and exits. When a connection is present it configures the
WebView settings and loads the target URL.Activity chain
SplashActivity is declared as the MAIN / LAUNCHER activity in the manifest, so it is always the entry point. MainActivity is declared with android:exported="false" — it can only be started from within the app.
WebView Configuration
MainActivity applies the following settings to the WebView instance before loading the URL:
| Setting | Value | Purpose |
|---|---|---|
setJavaScriptEnabled | true | Required for the FastAPI static frontend (uses app.js) |
setDomStorageEnabled | true | Enables localStorage / sessionStorage used by the chat UI |
setOverScrollMode | OVER_SCROLL_NEVER | Removes the rubber-band bounce effect for a cleaner feel |
WebViewClientDemo | custom subclass | Intercepts URL changes and loads them inside the WebView rather than opening the system browser |
WebChromeClientDemo | custom subclass | Implements onShowFileChooser so users can pick a PDF from device storage for upload |
File upload support
WebChromeClientDemo overrides onShowFileChooser to bridge the HTML <input type="file"> element to Android’s file picker:
filePathCallback.onReceiveValue(results) in the ActivityResultLauncher registered at activity creation.
Back-button navigation
onBackPressed checks whether the WebView has a back history. If so it navigates back inside the web app; if not, it shows a confirmation dialog before exiting:
Building the APK
Open the project in Android Studio
Launch Android Studio and choose Open, then select the
Android App/
subdirectory of the repository (the directory that contains app/ and the
root build.gradle). Allow Gradle to sync — it will download all
dependencies automatically.Update the target URL
Open Save the file.
Android App/app/src/main/java/com/jatinmehra/pdfinsightpro/MainActivity.java
and replace the default URL with your own deployment:Build a release APK
From the terminal inside the Or in Android Studio: Build → Generate Signed Bundle / APK → APK → Release.
Android App/ directory:Permissions
The following permissions are declared inAndroidManifest.xml:
| Permission | Required | Purpose |
|---|---|---|
android.permission.INTERNET | Yes | Allows the WebView to make HTTP/HTTPS requests to the deployed server |
android.permission.ACCESS_NETWORK_STATE | Yes | Used by CheckNetwork.isInternetAvailable() to detect connectivity before loading |
android.permission.WRITE_EXTERNAL_STORAGE | Runtime (API ≥ 23) | Requested at runtime on Android 6.0+ to save downloads via the DownloadManager |
Minimum SDK
Extracted fromapp/build.gradle:
| Property | Value |
|---|---|
minSdk | 24 (Android 7.0 Nougat) |
targetSdk | 34 (Android 14) |
compileSdk | 34 |
versionName | 1.2.0 |
The Android app is a remote client — it has no embedded backend. The server
must be publicly reachable on the internet before the app can function. When
testing on a physical device,
localhost or 10.0.2.2 will not work;
you must deploy to Hugging Face Spaces (or another public host) and point
websiteURL at that address.