Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Niurka77/tf-app/llms.txt

Use this file to discover all available pages before exploring further.

Android requires every app to explicitly declare the system resources and device capabilities it needs before the operating system will grant access to them. These declarations live in android/app/src/main/AndroidManifest.xml as <uses-permission> elements. Without the correct entries, TF-App’s features — from loading the web bundle over the network to reading device location — will silently fail or throw errors at runtime. This page documents every permission TF-App needs, explains why each is required, and shows you how to add new ones as the app grows.

Current Permissions

TF-App’s AndroidManifest.xml currently declares one permission:
<uses-permission android:name="android.permission.INTERNET" />
Why INTERNET is required: Capacitor renders TF-App inside an Android WebView. That WebView must be able to make outbound network connections in two scenarios. During development, when server.url is set in capacitor.config.json, the WebView fetches all assets from the Vite dev server running on your local machine. In production, the bundled JavaScript makes fetch() calls to TF-App’s backend APIs to load property listings, user sessions, and other real estate data. Without INTERNET, every one of those requests is blocked by the OS and the app displays nothing.

Adding Geolocation Permissions

Real estate apps commonly need the device’s physical location — for example, to show nearby listings or calculate distances from a searched address. Android requires two separate permission entries for location:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Add both entries inside the <manifest> element in AndroidManifest.xml, alongside the existing INTERNET permission. ACCESS_FINE_LOCATION enables GPS-level precision. ACCESS_COARSE_LOCATION enables cell-tower and Wi-Fi triangulation, which is less precise but consumes less battery. Declaring both lets Android choose the most appropriate source and allows users who deny fine location to still grant coarse location.

Runtime Permission Requests

ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION are classified as dangerous permissions under Android’s permission model (introduced in Android 6.0 / API 23). Unlike INTERNET, which is granted automatically at install time, dangerous permissions must be explicitly accepted by the user in a system dialog at runtime — the first time your code tries to use them. TF-App’s Vite JavaScript can trigger this prompt through the standard Web Geolocation API. The browser/WebView handles requesting the permission dialog automatically on the first call:
navigator.geolocation.getCurrentPosition(
  (pos) => {
    const { latitude, longitude } = pos.coords;
    // Use coordinates to filter nearby listings
  },
  (err) => {
    showMessage('Permission Denied', 'Location access is required for this feature.');
  }
);
If the user taps Deny, the error callback fires with a PERMISSION_DENIED code. Always handle this gracefully — show a clear message and allow the user to continue using the app without location if possible.
Users can deny dangerous permissions, revoke them later in Settings → Apps → TF-App → Permissions, or choose Don’t ask again, which permanently suppresses the system dialog. Your code must handle all of these cases without crashing. Never assume a dangerous permission is granted just because it is declared in the manifest.

File Access Permissions

TF-App’s AndroidManifest.xml already includes a FileProvider declaration inside the <application> block:
<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths"></meta-data>
</provider>
The FileProvider is a standard Android component that allows an app to securely share files with other apps (such as the camera app or a PDF viewer) via content URIs, without exposing the raw filesystem path. Capacitor installs this provider automatically because several of its plugins depend on it to pass file references across process boundaries. The grantUriPermissions="true" attribute means the app can temporarily grant another app read access to a specific file without needing broad READ_EXTERNAL_STORAGE permission.
Do not remove or modify the FileProvider declaration. It is required by Capacitor’s Android bridge and will be referenced by future Capacitor plugins that deal with files, photos, or share sheets. Removing it will cause runtime crashes in those plugin operations.
If TF-App later adds a file picker or document upload feature, you will need to add explicit storage permissions for devices running Android 9 (API 28) or lower. For Android 10+ (API 29+), scoped storage makes READ_EXTERNAL_STORAGE unnecessary for most use cases.

Permission Reference Table

Use this table as a quick reference when adding new features to TF-App:
PermissionRequired ForWhen to Add
INTERNETAll network requests and API callsAlready present
ACCESS_FINE_LOCATIONPrecise GPS coordinatesWhen using geolocation features
ACCESS_COARSE_LOCATIONApproximate location via cell/Wi-FiWhen using geolocation features
CAMERAPhoto capture for property imagesIf adding camera features
READ_EXTERNAL_STORAGEReading files from device storageIf adding a file picker (API ≤ 28)
To add any of these, insert the corresponding <uses-permission> line inside the <manifest> element of android/app/src/main/AndroidManifest.xml, then run npx cap sync to ensure the Android project reflects the updated manifest before your next build.

Build docs developers (and LLMs) love