Introducing scrcast

Introducing scrcast

Introducing scrcast: Kotlin-first configure and go screen recording on Android

I'm excited to announce scrcast - an open-source Kotlin-first configure and go screen recording library for Android. scrcast aims to be the screen recording app's or QA team's best friend. scrcast is an abbreviation of the full feature screen capture

Here's how simple a screen recording could be:

But with a little configuration unlocks a world of possibilities:

scrcast will also handle the storage permission requirement and request for you!

Why a screen recording library?

While this is probably an edge case need for some, the hoops to setup a a MediaProjection, VirtualDisplay and provide it to MediaRecorder for recording purposes isn't the most straight forward task and it's not well known or documented really, so I felt the opportunity was available to simply this for developers. Also, with the number of QA teams that I have worked with consistently asking for why their isn't a streamlined and simple screen recording app matching the native iOS experience (prior to Android 11), it's something that I felt that I could take advantage of as well. Scrcast was created with the concept of a simple API being available for developers to add a screen recording service to their users without having to struggle. This was done by:

  • Leveraging Kotlin language features including extension functions, lambda parameters and sealed classes to create a simple API.
  • Use modern dependencies. Taking full advantage of Android Jetpack was the primary focus, with future support for lifecycle hooks via AndroidX in the works.
  • Lightweight. scrcast is only 1000 lines of code.

Usecases

So you now are probably asking where would I use this?

  • Add it to any app hidden by developer flags for your QA team to record your app from your app.
    • Quick, no context switching
  • Existing screen recording apps out their looking to offload some of the heavy lifting of the MediaProject → VirtualDisplay → recording process.

Getting started

I'm extremely excited to being sharing scrcast with the community. There is a world of configurations available to fit you and your users needs/wants that I didn't want to flood this post with, so be sure to check out the documentation and the Github repository. You can also find me on Twitter here.