2.34.1.2
OpenTok.Net.Android 2.34.1.2
An ergonomics release. The native SDK is unchanged — still opentok-android-sdk 2.34.1 with
com.vonage:webrtc 121.1.101 — and OpenTok.Net.webrtc.Dependency.Android is unchanged at
121.1.101.1.
This release is source-breaking in one way, described first.
Breaking: listener event args have named properties
opentok-android-sdk's classes.jar is compiled without javac -parameters, so it carries no
parameter names at all and class-parse fell back to positional placeholders. Every generated
EventArgs therefore exposed P0, P1, P2:
session.StreamReceived += (s, e) => Subscribe(e.P1); // which one was the stream?The parameters are now named, and so are the properties:
session.StreamReceived += (s, e) => Subscribe(e.Stream);The renames cover the listeners an app actually implements — Session's session, connection,
signal, archive, reconnection, mute and stream-properties listeners, PublisherKit's publisher,
video, audio-level and mute listeners, SubscriberKit's subscriber, stream, video, audio-level and
captions listeners, and Publisher.CameraListener. The stats and transformer listeners are
deliberately left alone: their single parameter is a stats object whose type already says what it
is.
Two names to watch when updating: Session.SignalEventArgs is Session/Type/Data/Connection
in that order, and Session.ArchiveStartedEventArgs uses ArchiveName rather than Name (Name
on an event-args type reads as the event's own name).
Code using the listener interfaces rather than the events is unaffected.
Added: Publisher.Builder and Subscriber.Builder return their own types
Java's covariant Publisher build() override, and every fluent setter on Publisher.Builder, are
dropped by class-parse along with their synthetic bridge methods — so the only members a consumer
could reach were the inherited PublisherKit.Builder ones. That made this necessary:
var publisher = new Publisher.Builder(context).Build().JavaCast<Publisher>();and made the obvious alternative a trap, because a plain (Publisher) cast throws — the managed
peer was constructed as a PublisherKit, and only JavaCast asks JNI for a new peer of the right
type.
Additions/Builders.cs restores the covariant returns, on Build() and on every setter, so a chain
stays on Publisher.Builder throughout:
var publisher = new Publisher.Builder(context).Name("me").Build(); // PublisherSubscriber.Builder gets the same treatment. Existing JavaCast<Publisher>() calls keep working.
Changed: derived dependency versions are watched
com.google.flogger 0.6 and com.google.guava 31.1-android were written inline in
AndroidIgnoredJavaDependency items. They are derived pins — their only correct value is whatever
opentok-android-sdk's POM declares — and a stale one does not fail the build, it silently stops
matching, so the next SDK bump reports an XA4241 naming a version that appears nowhere in the
repository. They are now FloggerVersion and GuavaVersion in Directory.Build.props, watched by
the upstream-drift workflow the same way WebrtcVersion already was.
Changed: BG8A04 is suppressed
Every parameter rename raises "Metadata.xml element ... matched no nodes" — ~240 warnings a build —
while demonstrably working on all three target frameworks: the generator applies the transform and
then reports the path as unmatched against the document it has already rewritten. Leaving it on
would bury a genuine unmatched path among the spurious ones. The renames are asserted directly
against the packed assembly by BindingApiTests.Listener_event_args_carry_named_properties
instead, and the collision fixes in the same file fail the build outright if they stop matching.
Sample: the Android sample now connects a session
samples/OpenTok.Sample.Android was preview-only — it created a Publisher and showed the camera,
and never constructed a Session at all. It now mirrors the iOS sample: API key / session id /
token entry, Connect / Disconnect / Publish, subscribe to the first remote stream, local and remote
video, and a status log.
Packages
Bound against com.opentok.android:opentok-android-sdk 2.34.1 and com.vonage:webrtc 121.1.101 (Maven Central). Each package publishes at its own version line; a row whose version did not move since the previous train was skipped by the push, not republished.
| Package | NuGet |
|---|---|
OpenTok.Net.Android |
2.34.1.2 |
OpenTok.Net.webrtc.Dependency.Android |
121.1.101.1 |