Trouble with the Android sample app


#1

Hello

I have recently downloaded the Android SDK here : https://github.com/gotenna

I have put in Android Studio and easly get it built …

But when I launch it on my Android devices, major functions seems to work

  • send echo : OK
  • send get system info : OK
  • set GID : OK
  • create group : OK (the receiver pops up indicating that is has been invited in the group)

but “send private message” does not work “correctly” : in the sender app, I can choose receiver (among Alice, Bob, Carol and Doug, minus on depending on the profile associated as GID to the sender).

The same trouble with “Send Broadcast message”

When sending messages, I can see the gotenna sender blinking and the gotenna receiver also blinking but to callback is fired on the receiver smartphone (the app is open).

Is there a problem of authorization in the manifest ?

I have built with API25 Android 7.1.1. (Nougat) and 25.0.3 Build version in Android Studio.

Gradle version 4.4 + Android plugin version 3.1.4

Gotenna-sdk .aar is correctly associated in the dependencies list of the module (otherwise we would not build …).

What is missing ?


#4

I give my own reply :frowning:

I have made som debug test …

In “incomingmessagesmanager.java”, the callback for reception is correctly fired but the call to “notifyIncomingMessage” does nothing !

/////// in https://github.com/gotenna/PublicSDK/blob/master/android-public-sdk/gotennasdksample/sample/src/main/java/com/gotenna/sdk/sample/managers/IncomingMessagesManager.java ///////////////
@Override
public void onIncomingMessage(GTBaseMessageData gtBaseMessageData)
{
(…)
notifyIncomingMessage(incomingMessage);
(…)
}
///////////

////////
private void notifyIncomingMessage(final Message incomingMessage)
{
synchronized (incomingMessageListeners)
{
for (IncomingMessageListener incomingMessageListener : incomingMessageListeners)
{
incomingMessageListener.onIncomingMessage(incomingMessage);
}
}
}
///////////

The code in PrivateMessagesPresenter that implements IncomingMessage Listener (https://github.com/gotenna/PublicSDK/blob/8fdf9dd26fca0e93e78bcc868d9c857930aa20a7/android-public-sdk/gotennasdksample/sample/src/main/java/com/gotenna/sdk/sample/messages/PrivateMessagesPresenter.java) is not activated ?

Any idea ?


#5

Replying to myself …

I got it work :slight_smile:

Looking deeply into the source code, I managed to detect that reception of messages should be catched by listeners in the app. There are 3 listeners : one for private,one for group and one for broadcast.

But the point is that these receivers at the distant gotenna are initiated only if the corresponding activity is opened !! Then, if private messages is opened on both smartphones, reception of incoming messages will be realized.

I expected that reception of incoming messages would fire some notifications in the menu page, but this is the case.

All OK now … but sample app shoud be a bit modified to enhance comprehension of reception.


#6

@goTennaUser_2390 Glad you were able to get everything to work properly yourself! I have made a note in our internal ticket tracker to make sure we review that section of the sample app, to see what we can do to make it easier to understand for our next sdk update. Thanks!