An open API service indexing awesome lists of open source software.

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

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: ![Latest version](https://img.shields.io/maven-central/v/org.matrix.android/matrix-android-sdk2)

## 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)