Skip to content
Last updated

Manifest and Permissions

This is where the SDK connects to the Android OS.

Step 1: Add required permissions

File: app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />

Why each permission exists

  • ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION: Bubbl uses location to refresh campaigns and geofences.
  • POST_NOTIFICATIONS: required on Android 13+ to display push notifications.
  • FOREGROUND_SERVICE + FOREGROUND_SERVICE_LOCATION: required for continuous location updates.
  • INTERNET: required for API calls and content delivery.
  • VIBRATE: used by notification effects.

Optional permissions used in the host app

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Background Location

ACCESS_BACKGROUND_LOCATION is only required if your app needs location tracking while in the background. Storage permissions are only used for log sharing.

Step 2: Register Bubbl services and FCM handler

<application
    android:name=".MyApplication"
    ...>

    <service
        android:name="tech.bubbl.sdk.services.LocationUpdatesService"
        android:foregroundServiceType="location" />

    <service
        android:name="tech.bubbl.sdk.services.MyFirebaseMessagingService"
        android:exported="false">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
</application>

Why

Android will not launch services that are not declared in the manifest.

Step 3: Default notification channel

<meta-data
    android:name="com.google.firebase.messaging.default_notification_channel_id"
    android:value="bubbl_push" />

Why

This ensures notifications are grouped into a known channel if your app does not create one.

Step 4: Map API key (only if you use maps)

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="YOUR_MAPS_KEY" />

Why

Required for Google Maps MapView.

Step 5: FileProvider (only if you share logs)

<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" />
</provider>
FileProvider Requirement

This requires a res/xml/file_paths.xml file. The host app references it but does not include it, so log sharing would crash unless you add the file.