Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Tyrus with OkHttp #107

Merged
merged 27 commits into from
Apr 17, 2024
Merged

Replace Tyrus with OkHttp #107

merged 27 commits into from
Apr 17, 2024

Conversation

niyatim23
Copy link
Contributor

@niyatim23 niyatim23 commented Apr 8, 2024

Issue #, if available:

Description of changes:

  • Introduce GitHub Actions CI with Java 11 and 17. Java 8 is unsupported for our existing SDK already
niyatim@ amazon-kinesis-video-streams-webrtc-sdk-android % java -version
java version "1.8.0_401"
Java(TM) SE Runtime Environment (build 1.8.0_401-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.401-b10, mixed mode)
niyatim@ amazon-kinesis-video-streams-webrtc-sdk-android % git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   app/src/main/res/raw/awsconfiguration.json

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	app/libs/libwebrtc-115.0.0.aar

no changes added to commit (use "git add" and/or "git commit -a")
niyatim@ amazon-kinesis-video-streams-webrtc-sdk-android % ./gradlew build 

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/niyatim/Desktop/aws-kvs/amazon-kinesis-video-streams-webrtc-sdk-android/app/build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     Your current JDK is located in  /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/jre
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org/

BUILD FAILED in 328ms
niyatim@ amazon-kinesis-video-streams-webrtc-sdk-android %
  • Migrate from Tryus to OkHttp
    • Use a websocketListener in from OkHttp in app/src/main/java/com/amazonaws/kinesisvideo/signaling/SignalingListener.java
  • Version bumps
    • Upgrade compileSdk and targetSdk to 34
    • Upgrade aws-version from '2.73.0' to '2.75.0'
    • Upgrade com.google.code.gson:gson from '2.8.9' to '2.10.1'
    • Upgrade com.google.android.material:material from '1.9.0' to '1.11.0'
    • Upgrade androidx.test.espresso:espresso-core from '3.4.0' to '3.5.1'
  • Cleanup
    • Cleanup app/src/main/java/com/amazonaws/kinesisvideo/demoapp/KinesisVideoWebRtcDemoApp.java by removing the unused log
    • Cleanup app/src/main/java/com/amazonaws/kinesisvideo/demoapp/activity/StartUpActivity.java by using lambda
    • Cleanup app/src/main/java/com/amazonaws/kinesisvideo/demoapp/fragment/StreamWebRtcConfigurationFragment.java by removing unused imports and use !mIceServerList.isEmpty() instead of mIceServerList.size() > 0
    • Add NonNull annotation in app/src/main/java/com/amazonaws/kinesisvideo/signaling/model/Event.java
    • Cleanup app/src/main/java/com/amazonaws/kinesisvideo/demoapp/activity/WebRtcActivity.java

Testing

  • Android master
    • C Viewer
    • JS Viewer (host)
    • JS Viewer (relay)
  • Android viewer
    • C Master
    • JS Master (host)
    • JS Master (relay)
      By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@stefankiesz stefankiesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, okhttp seems a lot more modern and easier to use.

@niyatim23 niyatim23 requested a review from disa6302 April 11, 2024 18:38
Copy link
Contributor

@sirknightj sirknightj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled the latest and deployed the app onto the Samsung Galaxy S22 Ultra and it was able to connect to the JS as master and viewer on both LTE and WiFi. Great work!

Copy link
Contributor

@hassanctech hassanctech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic @niyatim23 !!

@niyatim23 niyatim23 merged commit ea44a59 into master Apr 17, 2024
4 checks passed
@niyatim23 niyatim23 deleted the okhttp branch April 18, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants