Requirements for the Android SDK
This guide outlines the system requirements and development environment setup needed to use the Agentforce Mobile SDK for Android.
Development Environment
To develop using the Agentforce SDK, you’ll need:
- Android Studio: Android Studio Meerkat 2024.3.1 or newer
- Android Gradle Plugin: Version 8.9.1
- Kotlin: Version 1.9.22 or higher
- Minimum SDK Version: API level 29 (Android 10) or higher
- Jetpack Compose: The SDK’s UI components are built with Compose. Your project must be configured to use it.
Required Permissions
Several features of the SDK require user permissions.
- Camera access for image attachments
- Microphone access for voice input
- Storage access for file sharing
Update your AndroidManifest.xml with the following perms and providers.
1<uses-feature
2 android:name="android.hardware.camera"
3 android:required="false" />
4<uses-permission android:name="android.permission.RECORD_AUDIO" />
5<uses-permission android:name="android.permission.CAMERA" />
1<provider
2 android:name="androidx.core.content.FileProvider"
3 android:authorities="${applicationId}.fileprovider"
4 android:exported="false"
5 android:grantUriPermissions="true"
6 tools:replace="android:authorities">
7 <meta-data
8 android:name="android.support.FILE_PROVIDER_PATHS"
9 android:resource="@xml/file_paths"
10 tools:replace="android:resource" />
11</provider>
12
13<provider
14android:name="com.salesforce.android.agentforcesdkimpl.utils.AgentforcePDFFileProvider"
15 android:authorities="${applicationId}.pdffileprovider"
16 android:exported="false"
17 android:grantUriPermissions="true">
18 <meta-data
19 android:name="android.support.FILE_PROVIDER_PATHS"
20 android:resource="@xml/pdf_file_paths" />
21</provider>
Also, add file paths to res/xml.
@xml/file_paths
1<?xml version="1.0" encoding="utf-8"?>
2<paths>
3 <cache-path name="cache" path="." />
4</paths>
@xml/pdf_file_paths
1<?xml version="1.0" encoding="utf-8"?>
2<paths>
3 <cache-path
4 name="cache"
5 path="." />
6 <external-cache-path
7 name="external_cache"
8 path="." />
9 <files-path
10 name="files"
11 path="." />
12</paths>
Project Configuration
Gradle Configuration
1android {
2 compileSdk 35
3
4 defaultConfig {
5 minSdk 29
6 targetSdk 34
7 }
8
9 compileOptions {
10 isCoreLibraryDesugaringEnabled = true
11 sourceCompatibility = JavaVersion.VERSION_17
12 targetCompatibility = JavaVersion.VERSION_17
13 }
14
15
16 kotlinOptions {
17 jvmTarget = "17"
18 }
19
20 buildFeatures {
21 compose = true
22 }
23
24 composeOptions {
25 kotlinCompilerExtensionVersion = "1.5.8"
26 }
27}
Next Steps