Skip to content
🔥Android screen record helper, Android 屏幕录制
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea commit LICENSE Jun 27, 2019
app commit LICENSE Jun 27, 2019
gradle/wrapper first commit Jun 21, 2019
screenrecord support audio record Jun 21, 2019
.gitignore first commit Jun 21, 2019
LICENSE commit LICENSE Jun 27, 2019 Update Jun 27, 2019 Update Jun 25, 2019
build.gradle commit the readme-zh Jun 21, 2019 first commit Jun 21, 2019
gradlew first commit Jun 21, 2019
gradlew.bat first commit Jun 21, 2019
settings.gradle first commit Jun 21, 2019


🔥screen record helper


API License


  1. screen record
  2. audio record
  3. support stripping environment volume
  4. support saving to album
  5. support for custom duration
  6. support for custom path and name
  7. resist the test of DAU 1 million users


How to use it

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url '' }

Step 2. Add the dependency

dependencies {
    implementation 'com.github.nanchen2251:ScreenRecordHelper:1.0.2'

Step 3. Just use it in your project

// start screen record
if (screenRecordHelper == null) {
    screenRecordHelper = ScreenRecordHelper(this, null, PathUtils.getExternalStoragePath() + "/nanchen")
screenRecordHelper?.apply {
    if (!isRecording) {
        // if you want to record the audio,you can set the recordAudio as true

// You must rewrite the onActivityResult
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && data != null) {
        screenRecordHelper?.onActivityResult(requestCode, resultCode, data)
// just stop screen record
screenRecordHelper?.apply {
    if (isRecording) {

Step 4. if you want to mix the audio into your video,you just should do

// parameter1 -> The last video length you want
// parameter2 -> the audio's duration
// parameter2 -> assets resource
stopRecord(duration, audioDuration, afdd)

Step 5. If you still don't understand, please refer to the demo

About the author

   欢迎投稿(关注)我的唯一公众号,公众号搜索 nanchen 或者扫描下方二维码:


 Copyright 2019 nanchen(刘世麟)

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 See the License for the specific language governing permissions and
 limitations under the License.
You can’t perform that action at this time.