Requirements
- Android 5.0 (API 21)+
- Target SDK 30+
- Compile SDK 30+
- JVM target 1.8
- Kotlin 1.5.10+
Installation
Add the SDK to your project using your preferred repository:Add Maven Central to your project-level Add the dependency to your module-level If your minSDKVersion is below 24, there are additional configurations required. In your project build.gradle:
build.gradle
:build.gradle
:Replace
x.y.z
with the latest version number.Configuration
Managing conflicting file generation
In your app module’s build.gradle, add the following packaging options.ProGuard Rules
If using ProGuard, add these rules to yourproguard-rules.pro
:
Log Visibility Configuration
To control log visibility, add the following to yourbuild.gradle
:
Database Encryption (Optional)
The SDK does not employ database encryption by default. The database file is solely restricted to the application by the operating system, which is generally sufficient for most use cases.
Encryption Modes
NONE
No Encryption
Default mode with no encryption applied. Best performance.
Default mode with no encryption applied. Best performance.
AUTH
Token Security
Access token storage is encrypted. Recommended for balanced security.
Access token storage is encrypted. Recommended for balanced security.
ALL
Full Encryption
All database files are encrypted. Maximum security.
All database files are encrypted. Maximum security.
AUTH mode is recommended to introduce extra security with minimal performance compromise. Choose the encryption mode that aligns with your application’s specific requirements.
Implementation
Encryption Key Management
🔐 Secure Key Generation & Storage
🔐 Secure Key Generation & Storage
Enabling database encryption requires an encryption key. You must consistently pass the same key to the SDK. If a new key is supplied, the existing database will be erased and regenerated with the new key.Add the security library dependency:Secure key implementation:Usage in your Application class:
The level of security depends on your key generation and storage method. Follow industry standards for both key storage and generation.
Performance Considerations
Performance Impact: Database encryption adds computational overhead. Consider these factors:
- AUTH mode: ~5-8% performance impact
- ALL mode: ~10-15% performance impact
- Battery usage: Slightly increased due to encryption/decryption operations
- Storage: Minimal impact on storage size
Next Steps
Authentication Guide
Learn about session management and secure authentication flows
Chat Features
Start building chat and messaging features
Social Features
Add posts, feeds, and social interactions
Video Streaming
Implement live video and streaming features
Troubleshooting
Build Issues
Build Issues
Dependency conflicts: Use the latest versions and ensure all Amity dependencies use the same versionProGuard issues: Make sure you’ve added the required ProGuard rulesMinimum SDK version: Ensure your app’s minimum SDK is at least API 21
Runtime Issues
Runtime Issues
SDK not initialized: Make sure you call
AmityCoreClient.setup()
in your Application classAuthentication failures: Verify your API key and region settingsNetwork errors: Check internet permissions and network connectivityRxJava Issues
RxJava Issues
Missing RxJava: The SDK uses RxJava 2&3 - ensure you have the dependency addedThreading issues: Use
.subscribeOn(Schedulers.io())
for background operationsMemory leaks: Always dispose of your subscriptions in onDestroy()