Build an Android screen recording app

This guide explains how to make a screen recording app in Android using Kotlin, Android Studio and the platform screen-capture APIs. The finished application can record a phone display, show a persistent notification, save an MP4 to the device and share it through another app. The same foundation supports software tutorials, bug reports and product walkthroughs.

Install Android Studio, create an Empty Activity project and use a recent stable Android SDK. Kotlin, the Android Gradle Plugin and standard AndroidX libraries are sufficient for the first version. A physical handset is useful during development because display capture, microphone access and notification behaviour can differ from an emulator.

Developers and small businesses in Sydney, Melbourne and Brisbane often record quick demonstrations for customers or colleagues. Australian users also appreciate straightforward language, so controls such as “Start recording” and “Stop and save” are clearer than technical labels. Regional users across Queensland and Western Australia may have inconsistent mobile coverage, making offline recording important.

Screen capture can expose private information, so permission and privacy belong in the core design rather than being added later. The app should ask for capture access only after the user taps the record button, run as a visible foreground service and keep recordings on the device unless the user deliberately shares them.

Set up the Android project

Create a project named for your application, select Kotlin and configure a minimum SDK that covers your intended audience. AndroidX Core, Activity KTX and Lifecycle Service provide convenient access to modern APIs, while the screen-capture classes come from the Android framework. No proprietary screen-recording library is required for a basic release.

Create a small capture service and register it in the manifest. The service will own the screen projection, virtual display and recorder, preventing them from being destroyed when the main activity closes. Android 14 and later also require the media projection foreground-service declaration and its matching permission.

Request capture permission safely

Use MediaProjectionManager to create the system screen-capture intent. Launch that intent with ActivityResultContracts.StartActivityForResult, then pass the returned result code and intent data to the capture service. Android displays its own consent screen, and the app must not attempt to bypass that decision.

The service must call startForeground() before retrieving the MediaProjection on recent Android versions. Give it a notification titled “Screen recording” with an active status and a stop action. Android 13 and later use a separate notification permission, while the foreground-service notification remains essential for transparency and reliable operation.

Request microphone permission separately if the recording includes narration. Explain that microphone access is optional and let the user continue with a silent video when permission is declined. Do not bundle the microphone request into the screen-capture permission flow, because each permission has a distinct purpose.

Capture frames and encode recordings

After obtaining the media projection, create a VirtualDisplay using the surface supplied by MediaRecorder. Configure the recorder for MPEG-4 output with an H.264 video encoder, select a resolution that suits the display and choose a bitrate based on screen complexity. Text-heavy screens usually need more bitrate than static content.

Start the encoder before attaching the virtual display, then release the display, projection and recorder in a controlled order when the user stops. MediaRecorder simplifies MP4 creation, while MediaCodec and MediaMuxer provide finer control for more advanced applications. Handle orientation changes and avoid presenting stretched video by matching the aspect ratio to the captured display.

Capturing another app’s system audio involves extra restrictions and depends on the Android version, user selections and the source app’s playback policy. A microphone is the most predictable option for voice-over. Synchronise the audio and video tracks, stop them together and confirm that the final file opens correctly in YouTube, Google Photos and common messaging applications.

Add controls and polished interactions

Design one obvious recording control rather than placing several competing buttons on the screen. Change its colour and label while recording, display an elapsed timer and provide a clear stop action. The foreground notification should also stop the recording, ensuring that control remains available when the app is in the background.

For smoother transitions between the idle, recording and completed states, the MotionLayout animation guide explains how to animate constraints in Android views. Apply motion sparingly so it does not distract from the recording itself. Support TalkBack, visible focus states and large touch targets, particularly for users managing recordings on busy Sydney bus and train journeys.

Save, share and protect recordings

On Android 10 and later, save videos through MediaStore rather than requesting broad access to device storage. Place recordings in a dedicated Movies folder, mark the file as pending while it is being written and release the pending flag only after encoding finishes. Older Android versions may require the legacy storage permission and a path within shared storage.

Use Australian date formatting such as dd/MM/yyyy and include the app name in each filename so files remain easy to identify. Keep the recording list in the app with its duration, creation time and thumbnail. Let users delete files directly from that list and clear temporary data when a recording is cancelled.

Share selected videos using a content URI with temporary read permission. Never expose an unrestricted file path, and avoid uploading recordings to a server without clear consent. Screen recordings may contain messages, account details or work documents, so the interface should warn users to check sensitive notifications before beginning.

Test on real Android devices

Test the complete journey on several physical handsets running different Android releases. The Australian market includes devices from Samsung, Google, Motorola and other manufacturers, each with its own notification and battery-management behaviour. Check that recording survives backgrounding, screen rotation and low storage conditions, then verify that every session stops cleanly.

Include emulator testing for basic UI flows and physical-device testing for projection, encoding and microphone behaviour. Test on both Wi-Fi and mobile connections, especially if the app imports or uploads files. Monitor memory use during long recordings because screen activity can be demanding, and provide a maximum-duration option for users creating shorter updates.

Before publishing, disclose the screen-recording and foreground-service behaviour in the store listing and privacy policy. If data is collected or uploaded, explain its purpose and provide appropriate controls. A clear privacy policy, revocable permissions and local deletion features help establish trust without adding complexity to the initial release.

Open Android Studio and build the smallest complete version first: permission handling, a foreground service, silent MP4 capture and local saving. Run it on your own Android phone, confirm that the notification and stop action work, then add microphone narration and sharing once the recording path is dependable.

Give the app a simple Australian English interface, useful recording controls and a visible privacy message. Test it with a real screen-recording task, package the release and publish it for Android users. Record clearly, share responsibly and ship the first version with confidence.