https://github.com/matrix-org/matrix-android-sdk2-sample
Example project for using the android sdk
https://github.com/matrix-org/matrix-android-sdk2-sample
Last synced: about 1 year ago
JSON representation
Example project for using the android sdk
- Host: GitHub
- URL: https://github.com/matrix-org/matrix-android-sdk2-sample
- Owner: matrix-org
- License: apache-2.0
- Created: 2020-10-12T14:12:41.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T16:36:31.000Z (over 2 years ago)
- Last Synced: 2025-03-24T13:36:24.133Z (over 1 year ago)
- Language: Kotlin
- Size: 192 KB
- Stars: 27
- Watchers: 15
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# matrix-android-sdk2-sample
This is an example project for using the [matrix-android-sdk2](https://github.com/matrix-org/matrix-android-sdk2)
## Gradle
In your top level build.gradle file, you should have at least:
```gradle
buildscript {
ext.kotlin_version = "1.6.0"
repositories {
google()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
```
And for your app module build.gradle you should at least include:
```gradle
implementation 'org.matrix.android:matrix-android-sdk2:x.y.z'
```
replace `x.y.z` by the latest version: 
## AndroidManifest.xml file
Your application should at least contains the provider "InitializationProvider" to remove initialiwation of the WorkManager as below
```xml
[...]
// This is required as the WorkManager is already initialized by the SDK
```
## Code
Please have a look in the following files to know how to start using the sdk:
[SampleApp](app/src/main/java/org/matrix/android/sdk/sample/SampleApp.kt)
[Login](/app/src/main/java/org/matrix/android/sdk/sample/ui/SimpleLoginFragment.kt)
[RoomList](/app/src/main/java/org/matrix/android/sdk/sample/ui/RoomListFragment.kt)
[RoomDetail](/app/src/main/java/org/matrix/android/sdk/sample/ui/RoomDetailFragment.kt)