Giter Club home page Giter Club logo

matrix-android-sdk's Introduction

Buildkite Quality Gate Vulnerabilities Bugs

Important Announcement

This SDK is deprecated and the core team does not work anymore on it.

We strongly recommends that new projects use the new Android Matrix SDK.

We can provide best effort support for existing projects that are still using this SDK though.

matrix-android-sdk

The [Matrix] SDK for Android wraps the Matrix REST API calls in asynchronous Java methods and provides basic structures for storing and handling data.

It is an Android Studio (gradle) project containing the SDK module. https://github.com/vector-im/riot-android is the sample app which uses this SDK.

Overview

The Matrix APIs are split into several categories (see [matrix api]). Basic usage is:

  1. Log in or register to a home server -> get the user's credentials
  2. Start a session with the credentials
  3. Start listening to the event stream
  4. Make matrix API calls

Bugs / Feature Requests

Think you've found a bug? Please check if an issue does not exist yet, then, if not, open an issue on this Github repo. If an issue already exists, feel free to upvote for it.

Contributing

Want to fix a bug or add a new feature? Check if there is an corresponding opened issue. If no one is actively working on the issue, then please fork the develop branch when writing your fix, and open a pull request when you're ready. Do not base your pull requests off master.

Logging in

To log in, use an instance of the login API client.

HomeServerConnectionConfig hsConfig = new HomeServerConnectionConfig.Builder()
    .withHomeServerUri(Uri.parse("https://matrix.org"))
    .build();
new LoginRestClient(hsConfig).loginWithUser(username, password, new SimpleApiCallback<Credentials>());

If successful, the callback will provide the user credentials to use from then on.

Starting the matrix session

The session represents one user's session with a particular home server. There can potentially be multiple sessions for handling multiple accounts.

MXSession session = new MXSession.Builder(hsConfig, new MXDataHandler(store, credentials), getApplicationContext())
    .build();

sets up a session for interacting with the home server.

The session gives access to the different APIs through the REST clients:

session.getEventsApiClient() for the events API

session.getProfileApiClient() for the profile API

session.getPresenceApiClient() for the presence API

session.getRoomsApiClient() for the rooms API

For the complete list of methods, please refer to the [Javadoc].

Example Getting the list of members of a chat room would look something like this:

session.getRoomsApiClient().getRoomMembers(<roomId>, callback);

The same session object should be used for each request. This may require use of a singleton, see the Matrix singleton in the app module for an example.

The event stream

One important part of any Matrix-enabled app will be listening to the event stream, the live flow of events (messages, state changes, etc.). This is done by using:

session.startEventStream();

This starts the events thread and sets it to send events to a default listener. It may be useful to use this in conjunction with an Android Service to control whether the event stream is running in the background or not.

The data handler

The data handler provides a layer to help manage data from the events stream. While it is possible to write an app with no data handler and manually make API calls, using one is highly recommended for most uses. The data handler :

  • Handles events from the events stream
  • Stores the data in its storage layer
  • Provides the means for an app to get callbacks for events
  • Provides and maintains room objects for room-specific operations (getting messages, joining, kicking, inviting, etc.)
MXDataHandler dataHandler = new MXDataHandler(new MXMemoryStore());

creates a data handler with the default in-memory storage implementation.

Registering a listener

To be informed of events, the app needs to implement an event listener.

session.getDataHandler().addListener(eventListener);

This listener should subclass MXEventListener and override the methods as needed:

onPresenceUpdate(event, user) Triggered when a user's presence has been updated.

onLiveEvent(event, roomState) Triggered when a live event has come down the event stream.

onBackEvent(event, roomState) Triggered when an old event (from history), or back event, has been returned after a request for more history.

onInitialSyncComplete() Triggered when the initial sync process has completed. The initial sync is the first call the event stream makes to initialize the state of all known rooms, users, etc.

The Room object

The Room object provides methods to interact with a room (getting message history, joining, etc).

Room room = session.getDataHandler().getRoom(roomId);

gets (or creates) the room object associated with the given room ID.

Room state

The RoomState object represents the room's state at a certain point in time: its name, topic, visibility (public/private), members, etc. onLiveEvent and onBackEvent callbacks (see Registering a listener) return the event, but also the state of the room at the time of the event to serve as context for building the display (e.g. the user's display name at the time of their message). The state provided is the one before processing the event, if the event happens to change the state of the room.

Room history

When entering a room, an app usually wants to display the last messages. This is done by calling

room.requestHistory();

The events are then returned through the onBackEvent(event, roomState) callback in reverse order (most recent first).

This does not trigger all of the room's history to be returned but only about 15 messages. Calling requestHistory() again will then retrieve the next (earlier) 15 or so, and so on. To start requesting history from the current live state (e.g. when opening or reopening a room),

room.initHistory();

must be called prior to the history requests.

The content manager

Matrix home servers provide a content API for the downloading and uploading of content (images, videos, files, etc.). The content manager provides the wrapper around that API.

session.getContentManager();

retrieves the content manager associated with the given session.

Downloading content

Content hosted by a home server is identified (in events, avatar URLs, etc.) by a URI with a mxc scheme (mxc://matrix.org/xxxx for example). To obtain the underlying HTTP URI for retrieving the content, use

contentManager.getDownloadableUrl(contentUrl);

where contentUrl is the mxc:// content URL.

For images, an additional method exists for returning thumbnails instead of full-sized images:

contentManager.getDownloadableThumbnailUrl(contentUrl, width, height, method);

which allows you to request a specific width, height, and scale method (between scale and crop).

Uploading content

To upload content from a file, use

contentManager.uploadContent(filePath, callback);

specifying the file path and a callback method which will return an object on completion containing the mxc-style URI where the uploaded content can now be found.

See the sample app and Javadoc for more details.

References

License

Apache 2.0

matrix-android-sdk's People

Contributors

af-anssi avatar bamstam avatar billcarsonfr avatar bmarty avatar crystal-rainslide avatar dkanada avatar erikjohnston avatar ganfra avatar giomfo avatar joachimre avatar kegsay avatar krkk avatar krombel avatar leonhandreke avatar manuroe avatar ndarilek avatar osoitz avatar pvagner avatar s8321414 avatar sabrinaj avatar safaalfulaij avatar sim6 avatar songtaeseop avatar spantaleev avatar studinsky avatar szimszon avatar tyuoli avatar ujdhesa avatar weblate avatar ylecollen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matrix-android-sdk's Issues

LoginApiClient class not exist

To log in, use an instance of the login API client.

new LoginApiClient("https://matrix.org").loginWithPassword("user", "password", callback);

Where i can found this class ?

maybe need add this class on the this package "org.matrix.androidsdk.rest.client"

public class LoginApiClient extends LoginRestClient {

public LoginApiClient(String uri){
    super(new HomeserverConnectionConfig(Uri.parse(uri)));
}

public HomeserverConnectionConfig getConfig() {
    return mHsConfig;
}

}

Latest version , can not build under Android Studio

details
Error:Execution failed for task ':matrix-sdk:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Android\android-sdk\build-tools\21.0.0\aapt.exe'' finished with non-zero exit value -1073741819

I have found some explains about the error on Stackflow , but I don't find any resource which bring this error

IDE files

Not really sure on why not completely gitignore the .idea directory and *.iml files.

these will change on pretty much every dev machine and will cause conflicts and unnecessary diffs on unclean commits

MXSession:has no rooms

I created some rooms with roit app.Then I login sucess to get credentials and create session,but there is no room data in this session.And I can find room data in the session with roit app's logs.

My code that create session:
HomeServerConnectionConfig hsConfig = new HomeServerConnectionConfig(Uri.parse("https://matrix.org"), Uri.parse("https://vector.im"), credentials, new ArrayList<Fingerprint>(), false); IMXStore store = new MXFileStore(hsConfig, context); MXSession session = new MXSession(hsConfig, new MXDataHandler(store, credentials),context);

Why is it?

Crypto : The Ed25519 device is unexpectedly updated

Some users got their Ed25519 key updated.

I assume it is triggered because the crypto store has been corrupted or because the olm session is not properly retrieved.

In this case, the application should be logged out.

File uploads with file name containing a path

Different clients may choose to put the entire file path in m.body when uploading files, which is used as the default file name in saveMedia. A toast appears with an error: No such file or directory when trying to save the file.

Perhaps detecting if a file name contains a path, and just trimming it to contain only the name would fix the issue. I thought I'd inform you guys here to get your opinion instead of creating a PR immediately.

Room Creation: The new created room is not available while `success` callback is called

creating a room like this :

getMXSession().createRoom(name, topic, alias, 
RoomState.GUEST_ACCESS_FORBIDDEN, "private_chat", new 
ApiCallback<String>() {
           @Override
           public void onSuccess(String s) {
               Logger.in("Success room created  id " + s);

                getRooms() // triggers to another thread the get of 
room's list.

                 }

The callback success is correctly called. So my app requests for the
rooms list - (from another thread), the freshly created room is not
within the list. I made the test to request the list again few seconds
after, the room is in the list.

The point is, I do not receive any others event that indicate the room
is fully created and available within the list. (I miss a listener ?).
My feeling is that the room has been correctly created and exists to
server, but become available locally in the list at next sync
operation. Is this normal ?

Android 5.1.1 not compatible

Tried to download the app from the play store and it seems it hasn't caught up with the latest version of android. Is there anything stopping me from just cloning the repo and bumping the target sdk up? I'm on a nexus 7 if it matters.

MSession close operation with back trace error

I think there is an issue when using service MXSession.clear on Android SDK.
This is the error stack error I have
E/MXSession: Use of a released session :
dalvik.system.VMStack.getThreadStackTrace(Native Method)
java.lang.Thread.getStackTrace(Thread.java:1566)
org.matrix.androidsdk.MXSession.checkIfAlive(MXSession.java:313)
org.matrix.androidsdk.MXSession.getDataHandler(MXSession.java:380)
org.matrix.androidsdk.crypto.MXCrypto.close(MXCrypto.java:535)
org.matrix.androidsdk.MXSession.clearApplicationCaches(MXSession.java:605)
org.matrix.androidsdk.MXSession.clear(MXSession.java:639)
org.matrix.androidsdk.MXSession.clear(MXSession.java:615)
Indeed in MxSession.clear (line 627) we check internal attribute mIsAliveSession and set it to false
if (!mIsAliveSession) {
...
}mIsAliveSession = false;

And after, when we call MXCrypto.close -> MXSession.getDataHandler displays this error because mIsAliveSession = false;
Is it an expected behavior? Can we improve mIsAliveSession in this context?

New notification draining battery significantly

The new update has this unremovable notification as compared to other messaging apps. My stats say it drains on average 16% of my battery in a day running in the background, as compared to previously 3%.
tmp_29740-screenshot_20151130-2047401116979452

"uploadContent" method not found in ContentManager

In the README, it says one can upload content via

contentManager.uploadContent(filePath, callback)

However, no such method exists.
A similar method is found in the class MXMediasCache, problably this method should be used.

Register fail

HomeServerConnectionConfig hsConfig = new HomeServerConnectionConfig(Uri.parse("https://matrix.org"));
RegistrationParams params = new RegistrationParams();
params.username = "UserTest003";
params.password = "1234qwer";
new LoginRestClient(hsConfig).register(params, apiCallback);

Returned a matrix error without errorcode and errorinfo,but has a http error 'mReason: Unauthenticated,mStatus: 401'.
'new LoginRestClient(hsConfig).login(...)' is normal.
Why is it?

new MXSession always returns NullPointerException

MXSession session = new MXSession(api.getConfig(), handler, getApplicationContext());

java.lang.NullPointerException: Attempt to read from field 'java.lang.String org.matrix.androidsdk.rest.model.login.Credentials.userId' on a null object reference

at org.matrix.androidsdk.util.BingRulesManager.(BingRulesManager.java:99)
at org.matrix.androidsdk.MXSession.(MXSession.java:250)
at com.jhetox.matrix.client.MainActivity$1.onSuccess(MainActivity.java:45)
at com.jhetox.matrix.client.MainActivity$1.onSuccess(MainActivity.java:40)
at org.matrix.androidsdk.rest.client.LoginRestClient$6.success(LoginRestClient.java:151)
at org.matrix.androidsdk.rest.client.LoginRestClient$6.success(LoginRestClient.java:146)
at retrofit.CallbackRunnable$1.run(CallbackRunnable.java:45)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

Update robolectric plugin

When importing the sdk module into another project the gradle sync fails with the following error if using robolectric-gradle-plugin 0.14.0

Error:(12, 0) Cannot add a configuration with name 'testCompile' as a configuration with that name already exists.

Upgrading to robolectric-gradle-plugin 1.0.1 solves the issue. The plugin id is changed from robolectric to org.robolectric when upgrading.

Retrieve custom StateEvent

Hello,

I'm using the Android SDK to interact with a Matrix server and I need to retrieve a custom StateEvent with a type like com.corp.feature but I didn't find a way to call:
GET /_matrix/client/r0/rooms/{roomId}/state/{eventType}
Is it me having trouble understanding how the SDK works?
Is this call not supposed to be implemented in org.matrix.androidsdk.rest.api.RoomsApi?

Best regards,

Android Studio build fail

Executing tasks: [:matrix-sdk:generateDebugSources, :matrix-sdk:mockableAndroidJar, :matrix-sdk:prepareDebugUnitTestDependencies, :matrix-sdk:generateDebugAndroidTestSources, :matrix-sdk:compileDebugSources, :matrix-sdk:compileDebugUnitTestSources, :matrix-sdk:compileDebugAndroidTestSources]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:matrix-sdk:preBuild UP-TO-DATE
:matrix-sdk:preDebugBuild UP-TO-DATE
:matrix-sdk:checkDebugManifest
:matrix-sdk:preDebugAndroidTestBuild UP-TO-DATE
:matrix-sdk:preDebugUnitTestBuild UP-TO-DATE
:matrix-sdk:preReleaseBuild UP-TO-DATE
:matrix-sdk:preReleaseUnitTestBuild UP-TO-DATE
:matrix-sdk:prepareComAndroidSupportAppcompatV72103Library UP-TO-DATE
:matrix-sdk:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:matrix-sdk:prepareIoPristineLibjingle9690Library UP-TO-DATE
:matrix-sdk:prepareOlmSdkLibrary UP-TO-DATE
:matrix-sdk:prepareDebugDependencies
:matrix-sdk:compileDebugAidl UP-TO-DATE
:matrix-sdk:compileDebugRenderscript UP-TO-DATE
:matrix-sdk:generateDebugBuildConfig UP-TO-DATE
:matrix-sdk:mergeDebugShaders UP-TO-DATE
:matrix-sdk:compileDebugShaders UP-TO-DATE
:matrix-sdk:generateDebugAssets UP-TO-DATE
:matrix-sdk:mergeDebugAssets UP-TO-DATE
:matrix-sdk:generateDebugResValues UP-TO-DATE
:matrix-sdk:generateDebugResources UP-TO-DATE
:matrix-sdk:mergeDebugResources UP-TO-DATE
:matrix-sdk:processDebugManifest UP-TO-DATE
:matrix-sdk:processDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':matrix-sdk:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\wangjha\AppData\Local\Android\Sdk\build-tools\21.0.0\aapt.exe'' finished with non-zero exit value -1073741819

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 23.269 secs

The AS is the latest version.

Unable to use via Jitpack

Hi I tried to use this via Jitpack but I get the following error from Android Studio:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.matrix-org:matrix-android-sdk:v0.9.0.

Could not resolve com.github.matrix-org:matrix-android-sdk:v0.9.0.
Required by:
    project :app
 > Could not resolve com.github.matrix-org:matrix-android-sdk:v0.9.0.
    > Could not parse POM https://jitpack.io/com/github/matrix-org/matrix-android-sdk/v0.9.0/matrix-android-sdk-v0.9.0.pom
          > Missing required attribute: dependency groupId

Is there a way that can be fixed on the repo size or someone here with tips to fix it on my side?

Using MXFileStore in MXSession returns null pointer exception

Hi,
i am using Matrix Android SDK, for start a MXSession i need an IMXStore object, if i use MXMemoryStore i dont have any trouble but if i use MXFileStore, when i start MXSession.startEventStream the log returns:

E/AndroidRuntime: FATAL EXCEPTION: Thread-8
Process: com.example.project, PID: 11020
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.matrix.androidsdk.util.MXOsHandler.post(java.lang.Runnable)' on a null object reference
at org.matrix.androidsdk.data.store.MXFileStore$9.run(MXFileStore.java:2209)
at java.lang.Thread.run(Thread.java:764)

I create the MXFileStore using the same HomeServerConnectionConfig that for the MXSession object, and using the application context:

(I previusly have the Credentials object)
HomeServerConnectionConfig hsConfig = new HomeServerConnectionConfig(Uri.parse("https://matrix.org"));
hsConfig.setCredentials(credentials);
IMXStore imxStore = new MXFileStore(hsConfig, appContext);
session = new MXSession(hsConfig, new MXDataHandler(imxStore, credentials), appContext);

MXSession: getDirectChatRoomIdsList should return the room id of the pending invites

When the current end-user is invited to a direct chat by the user userIdA, the room id is not listed in the array returned by List<String> getDirectChatRoomIdsList(userIdA).

The android SDK must mark the invited room as direct during the server sync. This is possible by considering the potential is_direct flag in the content event.
(see details in matrix-ios-sdk https://github.com/matrix-org/matrix-ios-sdk/blob/63e891a5fb1a85486db94a14dfc098a394592696/MatrixSDK/Data/MXRoom.m#L204)

Login API - loginWithToken returns invalid token (403)

Hello,

On the first connection I am using loginWithPassword and storing the token given in the returned Credentials object.
This token is stored with the account manager.
Then I recover this token and try a loginWithToken everytime my app launches but I get an invalid token error with a "D/RestAdapterCallback: ## failure(): [loginWithPassword user] with error 403 Forbidden".

I displayed the stored token and the recovered one, they are exactly the same.

Thanks

Restore the membership events storage

The memberships events are not anymore stored because we used to have out of memory errors : there were too many small allocated objects.
So, by now, the redacted state events require an initial sync of the room.

App crashes when clicking "Members List" the first time.

The first time, when I click on the action bar button "Members list" with the members icon of a room that I entered the first time I get a crash:

Process: org.matrix.matrixandroidsdk, PID: 943
java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
at org.matrix.androidsdk.rest.model.User.getRealLastActiveAgo(User.java:84)
at org.matrix.matrixandroidsdk.adapters.RoomMembersAdapter$2.compare(RoomMembersAdapter.java:87)
at org.matrix.matrixandroidsdk.adapters.RoomMembersAdapter$2.compare(RoomMembersAdapter.java:68)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:320)
at java.util.TimSort.sort(TimSort.java:199)
at java.util.TimSort.sort(TimSort.java:169)
at java.util.Arrays.sort(Arrays.java:2010)
at java.util.Collections.sort(Collections.java:1883)
at android.widget.ArrayAdapter.sort(ArrayAdapter.java:275)
at org.matrix.matrixandroidsdk.adapters.RoomMembersAdapter.sortMembers(RoomMembersAdapter.java:119)
at org.matrix.matrixandroidsdk.fragments.RoomMembersDialogFragment.onCreateView(RoomMembersDialogFragment.java:125)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

okhttp v 2.2.0 : offline management

With okhttp 2.0.0, the requests used to triggered a network error within 1 second when there is no available network .

With okHttp 2.2.0, the network error is only triggered at the end of the request timeout (i.e 30s). It might lock the application launch in offline mode.

Call candidates merging not set

  • MXJingleCall
    • createLocalStream(): check the merging candidates portion of code. It seems that the merged candidates are never sent.

Backward Compatibility issue

Found a backward compatibility issue for SDK

Error:Execution failed for task ':dating:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/admin/Softwares/adt-bundle-mac-x86_64/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1

And found that is due to my project is using appcompat v7:20.0.0 meanwhile the library
Matrix SDK is using gradle dependency compile 'com.android.support:appcompat-v7:21.0.0'

First, in order to use Matrix SDK i need to upgrade current project to support v21, this doesn't make sense as to test Matrix SDK integration, we would need to update project to support v21 which cause a lot time and efforts.

Secondly, it is weird that the SDK contain the UI stuff like layout using appcompat style, adapter, fragment. I don't see a reason these codes should handle in sdk instead in app.

Lastly, it would best the sdk can support gradle dependency too.

Just my2cent. Thanks for the contribution!

"olm-sdk" not found on Android Studio 2.2

i found the solution:

import "olm-sdk"

comment on the sdk:

//compile(name: 'olm-sdk', ext: 'aar')
//flatDir {dir 'libs'}

and imports "'olm-sdk'" as module on the sdk:

compile project(':olm-sdk')

and import the sdk as module on you app:

compile project(':matrix-sdk')

Can't compile with react-native-webrtc.aar built from source

When using the new script to build the jitsi meet dependencies and also reusing the react-native-webrtc.aar lib to build the matrix-sdk I get the following errors:

matrix-android-sdk/matrix-sdk/src/main/java/org/matrix/androidsdk/call/MXWebRtcCall.java:553: error: cannot find symbol
            mFullScreenRTCView.setStream(mLocalMediaStream);
                              ^
  symbol:   method setStream(MediaStream)
  location: variable mFullScreenRTCView of type WebRTCView
matrix-android-sdk/matrix-sdk/src/main/java/org/matrix/androidsdk/call/MXWebRtcCall.java:624: error: cannot find symbol
                                            mPipRTCView.setStream(mLocalMediaStream);
                                                       ^
  symbol:   method setStream(MediaStream)
  location: variable mPipRTCView of type WebRTCView
matrix-android-sdk/matrix-sdk/src/main/java/org/matrix/androidsdk/call/MXWebRtcCall.java:756: error: cannot find symbol
                                    mFullScreenRTCView.setStream(mediaStream);
                                                      ^
  symbol:   method setStream(MediaStream)
  location: variable mFullScreenRTCView of type WebRTCView

Failed to serialise an event with a matrix exception

EventsThread Got an error while polling events 502 Bad Gateway
UnsentEventsManager Cannot resend it
UnsentEventsManager 502 Bad Gateway
UnsentEventsManager Unexpected Error sendEvent : roomId !xwKdLwTnTnBcuCfMcw:whitenoise.ch - eventType m.room.encrypted
...
MatrixMsgsListFrag AddMessage Row : commit
...
11-02 15:38:03.837 23752 24047 W System.err: java.io.NotSerializableException: retrofit.converter.GsonConverter
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1224)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1584)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1549)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1472)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1218)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
11-02 15:38:03.837 23752 24047 W System.err: at org.matrix.androidsdk.rest.model.Event.writeExternal(Event.java:935)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1499)
11-02 15:38:03.837 23752 24047 W System.err: at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1470)
11-02 15:38:03.838 23752 24047 W System.err: at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1218)
11-02 15:38:03.838 23752 24047 W System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)

The faulty line in Event.java is
output.writeObject(unsentException);
it seems there is an issue with such an unsent exception. Have you already encountered such an issue?

No sample app

The readme states as following:

It is an Android Studio (gradle) project containing two modules:

  • sdk - The SDK
  • app - The sample app using the SDK

There is no sample app in the current master branch, can you please point out to its location (if any)?

Firebase login

Hi,

Can I use firebase login (firebase auth) with matrix sdk login?
I have done firebase login and I have firebase user. How do you I connect my firebase user with matrix-sdk?

Unnecessary application tag in SDK manifest

The application tag in the sdk manifest adds attributes that collide with applications that it's included in, e.g.

Error:(9, 9) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:9:9
    is also present at test:matrix-sdk:unspecified:15:9 value=(@drawable/ic_launcher)
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:7:5 to override

Afaik the application tag doesn't really serve any purpose and could be removed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.